-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Brave browser actions avoid a small jump from small to large image
The default extension browser action image was set to 16dp when brave browser actions currently uses 18dp. This was barely noticeable when the extensions were loaded on profile creation since only the first window would make this jump and it would happen when the window is opening whilst other paints are occurring. Now that the rewards extension is delay-loaded when the button is clicked, it is more noticeable.
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
chromium_src/chrome/browser/extensions/extension_action_manager.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// you can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#include "brave/common/extensions/extension_constants.h" | ||
#include "brave/browser/ui/brave_actions/constants.h" | ||
|
||
// Avoid a jump from small image to large image when the non-default | ||
// image is set. | ||
#define BRAVE_GET_EXTENSION_ACTION \ | ||
if (action->default_icon() && ( \ | ||
extension.id() == brave_rewards_extension_id || \ | ||
extension.id() == brave_extension_id)) { \ | ||
action->SetDefaultIconImage(std::make_unique<IconImage>( \ | ||
profile_, &extension, *action->default_icon(), \ | ||
brave_actions::kBraveActionGraphicSize, \ | ||
ExtensionAction::FallbackIcon().AsImageSkia(), nullptr)); \ | ||
} | ||
#include "../../../../../chrome/browser/extensions/extension_action_manager.cc" | ||
#undef BRAVE_GET_EXTENSION_ACTION |
12 changes: 12 additions & 0 deletions
12
patches/chrome-browser-extensions-extension_action_manager.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/chrome/browser/extensions/extension_action_manager.cc b/chrome/browser/extensions/extension_action_manager.cc | ||
index 90884f9916494778fc182c49ac7709bc91f536b9..0b099db863682c226da5f6e2f67e684ed56da3ef 100644 | ||
--- a/chrome/browser/extensions/extension_action_manager.cc | ||
+++ b/chrome/browser/extensions/extension_action_manager.cc | ||
@@ -109,6 +109,7 @@ ExtensionAction* ExtensionActionManager::GetExtensionAction( | ||
ExtensionAction::ActionIconSize(), | ||
ExtensionAction::FallbackIcon().AsImageSkia(), nullptr)); | ||
} | ||
+ BRAVE_GET_EXTENSION_ACTION | ||
|
||
ExtensionAction* raw_action = action.get(); | ||
actions_[extension.id()] = std::move(action); |