summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrdevlin.cronin <rdevlin.cronin@chromium.org>2015-01-21 14:35:35 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-21 22:36:41 +0000
commitb7b07fd149ac2b41542551d1e699bc2c1812fcd7 (patch)
tree8e21fdd21f256ee974569129b91c2aee4f43dd6b
parent24fd209fd5257d3e3f0a88577dd079b19dcb620b (diff)
downloadchromium_src-b7b07fd149ac2b41542551d1e699bc2c1812fcd7.zip
chromium_src-b7b07fd149ac2b41542551d1e699bc2c1812fcd7.tar.gz
chromium_src-b7b07fd149ac2b41542551d1e699bc2c1812fcd7.tar.bz2
[Extensions Toolbar] Adjust wants to act appearance
As a placeholder for a "wants to act" appearance, we've been using the "hover" assets. Tweak this so that "wants to act" looks different from hover and has its own assets. BUG=417441 Review URL: https://codereview.chromium.org/855073004 Cr-Commit-Position: refs/heads/master@{#312482}
-rw-r--r--chrome/app/theme/default_100_percent/common/browser_action_raised.pngbin0 -> 3308 bytes
-rw-r--r--chrome/app/theme/default_100_percent/common/browser_toolbar_bezel_raised.pngbin0 -> 3308 bytes
-rw-r--r--chrome/app/theme/default_200_percent/common/browser_action_raised.pngbin0 -> 3933 bytes
-rw-r--r--chrome/app/theme/default_200_percent/common/browser_toolbar_bezel_raised.pngbin0 -> 3933 bytes
-rw-r--r--chrome/app/theme/theme_resources.grd2
-rw-r--r--chrome/browser/ui/cocoa/extensions/browser_action_button.mm2
-rw-r--r--chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm2
-rw-r--r--chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.mm9
-rw-r--r--chrome/browser/ui/toolbar/wrench_icon_painter.cc21
-rw-r--r--chrome/browser/ui/toolbar/wrench_icon_painter.h1
-rw-r--r--chrome/browser/ui/views/toolbar/toolbar_action_view.cc15
-rw-r--r--ui/resources/default_100_percent/common/textbutton_raised_bottom.pngbin0 -> 2722 bytes
-rw-r--r--ui/resources/default_100_percent/common/textbutton_raised_bottom_left.pngbin0 -> 2780 bytes
-rw-r--r--ui/resources/default_100_percent/common/textbutton_raised_bottom_right.pngbin0 -> 2780 bytes
-rw-r--r--ui/resources/default_100_percent/common/textbutton_raised_center.pngbin0 -> 2728 bytes
-rw-r--r--ui/resources/default_100_percent/common/textbutton_raised_left.pngbin0 -> 2839 bytes
-rw-r--r--ui/resources/default_100_percent/common/textbutton_raised_right.pngbin0 -> 2839 bytes
-rw-r--r--ui/resources/default_100_percent/common/textbutton_raised_top.pngbin0 -> 2715 bytes
-rw-r--r--ui/resources/default_100_percent/common/textbutton_raised_top_left.pngbin0 -> 2755 bytes
-rw-r--r--ui/resources/default_100_percent/common/textbutton_raised_top_right.pngbin0 -> 2761 bytes
-rw-r--r--ui/resources/default_200_percent/common/textbutton_raised_bottom.pngbin0 -> 2745 bytes
-rw-r--r--ui/resources/default_200_percent/common/textbutton_raised_bottom_left.pngbin0 -> 2897 bytes
-rw-r--r--ui/resources/default_200_percent/common/textbutton_raised_bottom_right.pngbin0 -> 2891 bytes
-rw-r--r--ui/resources/default_200_percent/common/textbutton_raised_center.pngbin0 -> 2738 bytes
-rw-r--r--ui/resources/default_200_percent/common/textbutton_raised_left.pngbin0 -> 2967 bytes
-rw-r--r--ui/resources/default_200_percent/common/textbutton_raised_right.pngbin0 -> 2906 bytes
-rw-r--r--ui/resources/default_200_percent/common/textbutton_raised_top.pngbin0 -> 2731 bytes
-rw-r--r--ui/resources/default_200_percent/common/textbutton_raised_top_left.pngbin0 -> 2876 bytes
-rw-r--r--ui/resources/default_200_percent/common/textbutton_raised_top_right.pngbin0 -> 2865 bytes
-rw-r--r--ui/resources/ui_resources.grd9
30 files changed, 39 insertions, 22 deletions
diff --git a/chrome/app/theme/default_100_percent/common/browser_action_raised.png b/chrome/app/theme/default_100_percent/common/browser_action_raised.png
new file mode 100644
index 0000000..8d411bb
--- /dev/null
+++ b/chrome/app/theme/default_100_percent/common/browser_action_raised.png
Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/browser_toolbar_bezel_raised.png b/chrome/app/theme/default_100_percent/common/browser_toolbar_bezel_raised.png
new file mode 100644
index 0000000..8d411bb
--- /dev/null
+++ b/chrome/app/theme/default_100_percent/common/browser_toolbar_bezel_raised.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/browser_action_raised.png b/chrome/app/theme/default_200_percent/common/browser_action_raised.png
new file mode 100644
index 0000000..68d316f
--- /dev/null
+++ b/chrome/app/theme/default_200_percent/common/browser_action_raised.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/browser_toolbar_bezel_raised.png b/chrome/app/theme/default_200_percent/common/browser_toolbar_bezel_raised.png
new file mode 100644
index 0000000..68d316f
--- /dev/null
+++ b/chrome/app/theme/default_200_percent/common/browser_toolbar_bezel_raised.png
Binary files differ
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd
index 018b4c4..3df1146 100644
--- a/chrome/app/theme/theme_resources.grd
+++ b/chrome/app/theme/theme_resources.grd
@@ -143,6 +143,7 @@
<if expr="is_macosx or is_ios">
<structure type="chrome_scaled_image" name="IDR_BROWSER_ACTION_H" file="common/browser_action_hover.png" />
<structure type="chrome_scaled_image" name="IDR_BROWSER_ACTION_P" file="common/browser_action_pressed.png" />
+ <structure type="chrome_scaled_image" name="IDR_BROWSER_ACTION_R" file="common/browser_action_raised.png" />
</if>
<structure type="chrome_scaled_image" name="IDR_BROWSER_ACTIONS_OVERFLOW" file="common/browser_actions_overflow_normal.png" />
<structure type="chrome_scaled_image" name="IDR_BROWSER_ACTIONS_OVERFLOW_H" file="common/browser_actions_overflow_hover.png" />
@@ -1164,6 +1165,7 @@
<structure type="chrome_scaled_image" name="IDR_TOOLBAR_BEZEL_HOVER" file="common/browser_toolbar_bezel_hover.png" />
<structure type="chrome_scaled_image" name="IDR_TOOLBAR_BEZEL_PRESSED" file="common/browser_toolbar_bezel_pressed.png" />
+ <structure type="chrome_scaled_image" name="IDR_TOOLBAR_BEZEL_RAISED" file="common/browser_toolbar_bezel_raised.png" />
<structure type="chrome_scaled_image" name="IDR_TOOLS_BAR" file="common/browser_tools_bar.png" />
<structure type="chrome_scaled_image" name="IDR_TOOLS_BAR_LOW" file="common/browser_tools_bar_low.png" />
<structure type="chrome_scaled_image" name="IDR_TOOLS_BAR_MEDIUM" file="common/browser_tools_bar_medium.png" />
diff --git a/chrome/browser/ui/cocoa/extensions/browser_action_button.mm b/chrome/browser/ui/cocoa/extensions/browser_action_button.mm
index 5091f5b..1dd98b2 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_action_button.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_action_button.mm
@@ -361,7 +361,7 @@ void ToolbarActionViewDelegateBridge::DoShowContextMenu() {
return;
if (viewController_->WantsToRun(webContents)) {
- [[self cell] setImageID:IDR_BROWSER_ACTION_H
+ [[self cell] setImageID:IDR_BROWSER_ACTION_R
forButtonState:image_button_cell::kDefaultState];
} else {
[[self cell] setImageID:IDR_BROWSER_ACTION
diff --git a/chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm b/chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm
index 8d4c9d4..05f7402 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm
@@ -121,7 +121,7 @@ bool BrowserActionTestUtil::ActionButtonWantsToRun(size_t index) {
[[[controller containerView] window] themeProvider];
DCHECK(themeProvider);
NSImage* wantsToRunImage =
- themeProvider->GetNSImageNamed(IDR_BROWSER_ACTION_H);
+ themeProvider->GetNSImageNamed(IDR_BROWSER_ACTION_R);
BrowserActionButton* button = [controller buttonWithIndex:index];
BrowserActionCell* cell =
base::mac::ObjCCastStrict<BrowserActionCell>([button cell]);
diff --git a/chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.mm b/chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.mm
index 136ac76..458b8d1 100644
--- a/chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.mm
+++ b/chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.mm
@@ -80,11 +80,12 @@ class WrenchIconPainterDelegateMac : public WrenchIconPainter::Delegate {
- (WrenchIconPainter::BezelType)currentBezelType {
if ([self isHighlighted])
return WrenchIconPainter::BEZEL_PRESSED;
- // If an overflowed toolbar action wants to run, we give the wrench menu a
- // "popped out" appearance - in practice, this is the same as the hovered
- // appearance.
- if ([self isMouseInside] || overflowedToolbarActionWantsToRun_)
+ if ([self isMouseInside])
return WrenchIconPainter::BEZEL_HOVER;
+ // If an overflowed toolbar action wants to run, we give the wrench menu a
+ // "popped out" appearance.
+ if (overflowedToolbarActionWantsToRun_)
+ return WrenchIconPainter::BEZEL_RAISED;
return WrenchIconPainter::BEZEL_NONE;
}
diff --git a/chrome/browser/ui/toolbar/wrench_icon_painter.cc b/chrome/browser/ui/toolbar/wrench_icon_painter.cc
index cdcef08..bdf54c3 100644
--- a/chrome/browser/ui/toolbar/wrench_icon_painter.cc
+++ b/chrome/browser/ui/toolbar/wrench_icon_painter.cc
@@ -71,10 +71,23 @@ void WrenchIconPainter::Paint(gfx::Canvas* canvas,
gfx::Point center = rect.CenterPoint();
// Bezel.
- if (bezel_type != BEZEL_NONE) {
- gfx::ImageSkia* image = theme_provider->GetImageSkiaNamed(
- bezel_type == BEZEL_HOVER ? IDR_TOOLBAR_BEZEL_HOVER
- : IDR_TOOLBAR_BEZEL_PRESSED);
+ int resource_id = 0;
+ switch (bezel_type) {
+ case BEZEL_NONE:
+ break;
+ case BEZEL_HOVER:
+ resource_id = IDR_TOOLBAR_BEZEL_HOVER;
+ break;
+ case BEZEL_PRESSED:
+ resource_id = IDR_TOOLBAR_BEZEL_PRESSED;
+ break;
+ case BEZEL_RAISED:
+ resource_id = IDR_TOOLBAR_BEZEL_RAISED;
+ break;
+ }
+
+ if (resource_id) {
+ gfx::ImageSkia* image = theme_provider->GetImageSkiaNamed(resource_id);
canvas->DrawImageInt(*image,
center.x() - image->width() / 2,
center.y() - image->height() / 2);
diff --git a/chrome/browser/ui/toolbar/wrench_icon_painter.h b/chrome/browser/ui/toolbar/wrench_icon_painter.h
index c50d7b2..efc7117 100644
--- a/chrome/browser/ui/toolbar/wrench_icon_painter.h
+++ b/chrome/browser/ui/toolbar/wrench_icon_painter.h
@@ -28,6 +28,7 @@ class WrenchIconPainter : gfx::AnimationDelegate {
BEZEL_NONE,
BEZEL_HOVER,
BEZEL_PRESSED,
+ BEZEL_RAISED,
};
enum Severity {
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
index 4bf8865..5046166 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
@@ -79,20 +79,11 @@ ToolbarActionView::~ToolbarActionView() {
void ToolbarActionView::DecorateWantsToRunBorder(
views::LabelButtonBorder* border) {
// Create a special border for when the action wants to run, which gives the
- // button a "popped out" state. In practice, this is the same appearance we
- // use for when the user hovers on the action.
- gfx::Insets insets = border->GetInsets();
- ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
-
+ // button a "popped out" state.
+ static const int kRaisedImages[] = IMAGE_GRID(IDR_TEXTBUTTON_RAISED);
border->SetPainter(false,
views::Button::STATE_NORMAL,
- views::Painter::CreateImagePainter(
- *rb.GetImageSkiaNamed(IDR_BUTTON_HOVER), insets));
- border->SetPainter(true,
- views::Button::STATE_NORMAL,
- views::Painter::CreateImagePainter(
- *rb.GetImageSkiaNamed(IDR_BUTTON_FOCUSED_HOVER),
- insets));
+ views::Painter::CreateImageGridPainter(kRaisedImages));
}
void ToolbarActionView::ViewHierarchyChanged(
diff --git a/ui/resources/default_100_percent/common/textbutton_raised_bottom.png b/ui/resources/default_100_percent/common/textbutton_raised_bottom.png
new file mode 100644
index 0000000..523f3dc
--- /dev/null
+++ b/ui/resources/default_100_percent/common/textbutton_raised_bottom.png
Binary files differ
diff --git a/ui/resources/default_100_percent/common/textbutton_raised_bottom_left.png b/ui/resources/default_100_percent/common/textbutton_raised_bottom_left.png
new file mode 100644
index 0000000..b95ea0e
--- /dev/null
+++ b/ui/resources/default_100_percent/common/textbutton_raised_bottom_left.png
Binary files differ
diff --git a/ui/resources/default_100_percent/common/textbutton_raised_bottom_right.png b/ui/resources/default_100_percent/common/textbutton_raised_bottom_right.png
new file mode 100644
index 0000000..180a96c
--- /dev/null
+++ b/ui/resources/default_100_percent/common/textbutton_raised_bottom_right.png
Binary files differ
diff --git a/ui/resources/default_100_percent/common/textbutton_raised_center.png b/ui/resources/default_100_percent/common/textbutton_raised_center.png
new file mode 100644
index 0000000..ae09d1a
--- /dev/null
+++ b/ui/resources/default_100_percent/common/textbutton_raised_center.png
Binary files differ
diff --git a/ui/resources/default_100_percent/common/textbutton_raised_left.png b/ui/resources/default_100_percent/common/textbutton_raised_left.png
new file mode 100644
index 0000000..3a5e8ff
--- /dev/null
+++ b/ui/resources/default_100_percent/common/textbutton_raised_left.png
Binary files differ
diff --git a/ui/resources/default_100_percent/common/textbutton_raised_right.png b/ui/resources/default_100_percent/common/textbutton_raised_right.png
new file mode 100644
index 0000000..91c469b
--- /dev/null
+++ b/ui/resources/default_100_percent/common/textbutton_raised_right.png
Binary files differ
diff --git a/ui/resources/default_100_percent/common/textbutton_raised_top.png b/ui/resources/default_100_percent/common/textbutton_raised_top.png
new file mode 100644
index 0000000..dfcc451
--- /dev/null
+++ b/ui/resources/default_100_percent/common/textbutton_raised_top.png
Binary files differ
diff --git a/ui/resources/default_100_percent/common/textbutton_raised_top_left.png b/ui/resources/default_100_percent/common/textbutton_raised_top_left.png
new file mode 100644
index 0000000..a5c4e6d
--- /dev/null
+++ b/ui/resources/default_100_percent/common/textbutton_raised_top_left.png
Binary files differ
diff --git a/ui/resources/default_100_percent/common/textbutton_raised_top_right.png b/ui/resources/default_100_percent/common/textbutton_raised_top_right.png
new file mode 100644
index 0000000..16f469d
--- /dev/null
+++ b/ui/resources/default_100_percent/common/textbutton_raised_top_right.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/textbutton_raised_bottom.png b/ui/resources/default_200_percent/common/textbutton_raised_bottom.png
new file mode 100644
index 0000000..c38b621
--- /dev/null
+++ b/ui/resources/default_200_percent/common/textbutton_raised_bottom.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/textbutton_raised_bottom_left.png b/ui/resources/default_200_percent/common/textbutton_raised_bottom_left.png
new file mode 100644
index 0000000..1131705
--- /dev/null
+++ b/ui/resources/default_200_percent/common/textbutton_raised_bottom_left.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/textbutton_raised_bottom_right.png b/ui/resources/default_200_percent/common/textbutton_raised_bottom_right.png
new file mode 100644
index 0000000..a9efee2
--- /dev/null
+++ b/ui/resources/default_200_percent/common/textbutton_raised_bottom_right.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/textbutton_raised_center.png b/ui/resources/default_200_percent/common/textbutton_raised_center.png
new file mode 100644
index 0000000..8fa6893
--- /dev/null
+++ b/ui/resources/default_200_percent/common/textbutton_raised_center.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/textbutton_raised_left.png b/ui/resources/default_200_percent/common/textbutton_raised_left.png
new file mode 100644
index 0000000..60f42ad
--- /dev/null
+++ b/ui/resources/default_200_percent/common/textbutton_raised_left.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/textbutton_raised_right.png b/ui/resources/default_200_percent/common/textbutton_raised_right.png
new file mode 100644
index 0000000..8f34cd7a
--- /dev/null
+++ b/ui/resources/default_200_percent/common/textbutton_raised_right.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/textbutton_raised_top.png b/ui/resources/default_200_percent/common/textbutton_raised_top.png
new file mode 100644
index 0000000..4125419
--- /dev/null
+++ b/ui/resources/default_200_percent/common/textbutton_raised_top.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/textbutton_raised_top_left.png b/ui/resources/default_200_percent/common/textbutton_raised_top_left.png
new file mode 100644
index 0000000..dbe4769
--- /dev/null
+++ b/ui/resources/default_200_percent/common/textbutton_raised_top_left.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/textbutton_raised_top_right.png b/ui/resources/default_200_percent/common/textbutton_raised_top_right.png
new file mode 100644
index 0000000..256ff1d
--- /dev/null
+++ b/ui/resources/default_200_percent/common/textbutton_raised_top_right.png
Binary files differ
diff --git a/ui/resources/ui_resources.grd b/ui/resources/ui_resources.grd
index 4c8fe3a..bdd4c38 100644
--- a/ui/resources/ui_resources.grd
+++ b/ui/resources/ui_resources.grd
@@ -519,6 +519,15 @@
<structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_PRESSED_TOP" file="common/textbutton_pressed_top.png" />
<structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_PRESSED_TOP_LEFT" file="common/textbutton_pressed_top_left.png" />
<structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_PRESSED_TOP_RIGHT" file="common/textbutton_pressed_top_right.png" />
+ <structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_RAISED_BOTTOM" file="common/textbutton_raised_bottom.png" />
+ <structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_RAISED_BOTTOM_LEFT" file="common/textbutton_raised_bottom_left.png" />
+ <structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_RAISED_BOTTOM_RIGHT" file="common/textbutton_raised_bottom_right.png" />
+ <structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_RAISED_CENTER" file="common/textbutton_raised_center.png" />
+ <structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_RAISED_LEFT" file="common/textbutton_raised_left.png" />
+ <structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_RAISED_RIGHT" file="common/textbutton_raised_right.png" />
+ <structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_RAISED_TOP" file="common/textbutton_raised_top.png" />
+ <structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_RAISED_TOP_LEFT" file="common/textbutton_raised_top_left.png" />
+ <structure type="chrome_scaled_image" name="IDR_TEXTBUTTON_RAISED_TOP_RIGHT" file="common/textbutton_raised_top_right.png" />
</if>
<if expr="toolkit_views">
<structure type="chrome_scaled_image" name="IDR_TEXT_SELECTION_HANDLE_CENTER" file="common/text_selection_handle_center.png" />