OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/wrench_menu.h" | 5 #include "chrome/browser/ui/views/wrench_menu.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 canvas->FillRect(gfx::Rect(w - 2, h - 2, 1, 1), border_color(state)); | 241 canvas->FillRect(gfx::Rect(w - 2, h - 2, 1, 1), border_color(state)); |
242 break; | 242 break; |
243 | 243 |
244 default: | 244 default: |
245 NOTREACHED(); | 245 NOTREACHED(); |
246 break; | 246 break; |
247 } | 247 } |
248 } | 248 } |
249 | 249 |
250 private: | 250 private: |
251 #if defined(USE_AURA) | |
Elliot Glaysher
2013/03/18 17:53:40
Please remember that aura is not a linux-only comp
Bobby Powers
2013/03/18 18:11:43
{Unfocused,Focused,Menu}BorderColor were already d
Bobby Powers
2013/03/18 19:59:53
I believe the current patch addresses this correct
| |
252 static SkColor border_color(CustomButton::ButtonState state) { | |
253 ui::NativeTheme *theme = ui::NativeTheme::instance(); | |
254 switch (state) { | |
255 case CustomButton::STATE_HOVERED: | |
256 return theme->GetSystemColor( | |
257 ui::NativeTheme::kColorId_UnfocusedBorderColor); | |
258 case CustomButton::STATE_PRESSED: | |
259 return theme->GetSystemColor( | |
260 ui::NativeTheme::kColorId_FocusedBorderColor); | |
261 default: | |
262 return theme->GetSystemColor( | |
263 ui::NativeTheme::kColorId_MenuBorderColor); | |
264 } | |
265 } | |
266 | |
267 static SkColor background_color(CustomButton::ButtonState state) { | |
268 ui::NativeTheme *theme = ui::NativeTheme::instance(); | |
269 switch (state) { | |
270 case CustomButton::STATE_HOVERED: | |
271 return theme->GetSystemColor( | |
272 ui::NativeTheme::kColorId_HotMenuItemBackgroundColor); | |
273 case CustomButton::STATE_PRESSED: | |
274 return theme->GetSystemColor( | |
275 ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor); | |
276 default: | |
277 return theme->GetSystemColor( | |
278 ui::NativeTheme::kColorId_MenuBackgroundColor); | |
279 } | |
280 } | |
281 #else | |
251 static SkColor border_color(CustomButton::ButtonState state) { | 282 static SkColor border_color(CustomButton::ButtonState state) { |
252 switch (state) { | 283 switch (state) { |
253 case CustomButton::STATE_HOVERED: return kHotBorderColor; | 284 case CustomButton::STATE_HOVERED: return kHotBorderColor; |
254 case CustomButton::STATE_PRESSED: return kPushedBorderColor; | 285 case CustomButton::STATE_PRESSED: return kPushedBorderColor; |
255 default: return kBorderColor; | 286 default: return kBorderColor; |
256 } | 287 } |
257 } | 288 } |
258 | 289 |
259 static SkColor background_color(CustomButton::ButtonState state) { | 290 static SkColor background_color(CustomButton::ButtonState state) { |
260 switch (state) { | 291 switch (state) { |
261 case CustomButton::STATE_HOVERED: return kHotBackgroundColor; | 292 case CustomButton::STATE_HOVERED: return kHotBackgroundColor; |
262 case CustomButton::STATE_PRESSED: return kPushedBackgroundColor; | 293 case CustomButton::STATE_PRESSED: return kPushedBackgroundColor; |
263 default: return kBackgroundColor; | 294 default: return kBackgroundColor; |
264 } | 295 } |
265 } | 296 } |
297 #endif | |
266 | 298 |
267 static SkColor touch_background_color(CustomButton::ButtonState state) { | 299 static SkColor touch_background_color(CustomButton::ButtonState state) { |
268 switch (state) { | 300 switch (state) { |
269 case CustomButton::STATE_HOVERED: return kHotTouchBackgroundColor; | 301 case CustomButton::STATE_HOVERED: return kHotTouchBackgroundColor; |
270 case CustomButton::STATE_PRESSED: return kPushedTouchBackgroundColor; | 302 case CustomButton::STATE_PRESSED: return kPushedTouchBackgroundColor; |
271 default: return kTouchBackgroundColor; | 303 default: return kTouchBackgroundColor; |
272 } | 304 } |
273 } | 305 } |
274 | 306 |
275 ButtonType TypeAdjustedForRTL() const { | 307 ButtonType TypeAdjustedForRTL() const { |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1151 bookmark_menu_delegate_.reset( | 1183 bookmark_menu_delegate_.reset( |
1152 new BookmarkMenuDelegate(browser_, | 1184 new BookmarkMenuDelegate(browser_, |
1153 browser_, | 1185 browser_, |
1154 parent, | 1186 parent, |
1155 first_bookmark_command_id_)); | 1187 first_bookmark_command_id_)); |
1156 bookmark_menu_delegate_->Init( | 1188 bookmark_menu_delegate_->Init( |
1157 this, bookmark_menu_, model->bookmark_bar_node(), 0, | 1189 this, bookmark_menu_, model->bookmark_bar_node(), 0, |
1158 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 1190 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, |
1159 bookmark_utils::LAUNCH_WRENCH_MENU); | 1191 bookmark_utils::LAUNCH_WRENCH_MENU); |
1160 } | 1192 } |
OLD | NEW |