diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 18:48:51 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 18:48:51 +0000 |
commit | 2b3df1bb2eb056d4be22e278787f75f6475c73fe (patch) | |
tree | b906238ab0f746c2357fc1a4884f3f738aa226f2 | |
parent | d5e9f10b883a42d8b78540088de8531c773c1707 (diff) | |
download | chromium_src-2b3df1bb2eb056d4be22e278787f75f6475c73fe.zip chromium_src-2b3df1bb2eb056d4be22e278787f75f6475c73fe.tar.gz chromium_src-2b3df1bb2eb056d4be22e278787f75f6475c73fe.tar.bz2 |
Use the same blue solid border among tray and launcher, for focus.
BUG=158345
Review URL: https://chromiumcodereview.appspot.com/11306012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164959 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/ash_constants.cc | 3 | ||||
-rw-r--r-- | ash/ash_constants.h | 5 | ||||
-rw-r--r-- | ash/launcher/launcher_view.cc | 19 | ||||
-rw-r--r-- | ash/system/audio/tray_volume.cc | 1 | ||||
-rw-r--r-- | ash/system/brightness/tray_brightness.cc | 1 | ||||
-rw-r--r-- | ash/system/tray/tray_constants.cc | 2 | ||||
-rw-r--r-- | ash/system/tray/tray_constants.h | 2 | ||||
-rw-r--r-- | ash/system/tray/tray_views.cc | 1 |
8 files changed, 30 insertions, 4 deletions
diff --git a/ash/ash_constants.cc b/ash/ash_constants.cc index fc76c8a..a54daf1 100644 --- a/ash/ash_constants.cc +++ b/ash/ash_constants.cc @@ -4,6 +4,7 @@ #include "ash/ash_constants.h" +#include "third_party/skia/include/core/SkColor.h" #include "ui/aura/window_property.h" namespace ash { @@ -15,4 +16,6 @@ const int kResizeOutsideBoundsSize = 6; const int kResizeOutsideBoundsScaleForTouch = 5; const int kResizeInsideBoundsSize = 1; +const SkColor kFocusBorderColor = SkColorSetRGB(64, 128, 250); + } // namespace ash diff --git a/ash/ash_constants.h b/ash/ash_constants.h index ad12a6f..7b8d3f7 100644 --- a/ash/ash_constants.h +++ b/ash/ash_constants.h @@ -9,6 +9,8 @@ #include "ui/aura/window.h" #include "ui/base/ui_base_types.h" +typedef unsigned int SkColor; + namespace ash { // The window is a constrained window and lives therefore entirely within @@ -28,6 +30,9 @@ ASH_EXPORT extern const int kResizeOutsideBoundsSize; ASH_EXPORT extern const int kResizeOutsideBoundsScaleForTouch; ASH_EXPORT extern const int kResizeInsideBoundsSize; +// The border color of keyboard focus for launcher items and system tray. +extern const SkColor kFocusBorderColor; + } // namespace ash #endif // ASH_ASH_CONSTANTS_H_ diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc index c5044ad..12f689e 100644 --- a/ash/launcher/launcher_view.cc +++ b/ash/launcher/launcher_view.cc @@ -6,6 +6,7 @@ #include <algorithm> +#include "ash/ash_constants.h" #include "ash/launcher/app_list_button.h" #include "ash/launcher/launcher_button.h" #include "ash/launcher/launcher_delegate.h" @@ -33,6 +34,7 @@ #include "ui/views/controls/menu/menu_model_adapter.h" #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/focus/focus_search.h" +#include "ui/views/focus_border.h" #include "ui/views/view_model.h" #include "ui/views/view_model_utils.h" #include "ui/views/widget/widget.h" @@ -93,6 +95,22 @@ class LauncherFocusSearch : public views::FocusSearch { DISALLOW_COPY_AND_ASSIGN(LauncherFocusSearch); }; +class LauncherButtonFocusBorder : public views::FocusBorder { + public: + LauncherButtonFocusBorder() {} + virtual ~LauncherButtonFocusBorder() {} + + private: + // views::FocusBorder overrides: + virtual void Paint(const View& view, gfx::Canvas* canvas) const OVERRIDE { + gfx::Rect rect(view.GetLocalBounds()); + rect.Inset(1, 1); + canvas->DrawRect(rect, kFocusBorderColor); + } + + DISALLOW_COPY_AND_ASSIGN(LauncherButtonFocusBorder); +}; + // ui::SimpleMenuModel::Delegate implementation that remembers the id of the // menu that was activated. class MenuDelegateImpl : public ui::SimpleMenuModel::Delegate { @@ -532,6 +550,7 @@ views::View* LauncherView::CreateViewForItem(const LauncherItem& item) { break; } view->set_context_menu_controller(this); + view->set_focus_border(new LauncherButtonFocusBorder); DCHECK(view); ConfigureChildView(view); diff --git a/ash/system/audio/tray_volume.cc b/ash/system/audio/tray_volume.cc index fd4c67a..6af69ac 100644 --- a/ash/system/audio/tray_volume.cc +++ b/ash/system/audio/tray_volume.cc @@ -6,6 +6,7 @@ #include <cmath> +#include "ash/ash_constants.h" #include "ash/shell.h" #include "ash/system/tray/system_tray_delegate.h" #include "ash/system/tray/tray_constants.h" diff --git a/ash/system/brightness/tray_brightness.cc b/ash/system/brightness/tray_brightness.cc index 34c4b18..425dc3b 100644 --- a/ash/system/brightness/tray_brightness.cc +++ b/ash/system/brightness/tray_brightness.cc @@ -5,6 +5,7 @@ #include "ash/system/brightness/tray_brightness.h" #include "ash/accelerators/accelerator_controller.h" +#include "ash/ash_constants.h" #include "ash/shell.h" #include "ash/system/brightness/brightness_control_delegate.h" #include "ash/system/tray/system_tray_delegate.h" diff --git a/ash/system/tray/tray_constants.cc b/ash/system/tray/tray_constants.cc index ccb8081..cd062e0 100644 --- a/ash/system/tray/tray_constants.cc +++ b/ash/system/tray/tray_constants.cc @@ -42,8 +42,6 @@ const SkColor kBorderDarkColor = SkColorSetRGB(0xaa, 0xaa, 0xaa); const SkColor kBorderLightColor = SkColorSetRGB(0xeb, 0xeb, 0xeb); const SkColor kButtonStrokeColor = SkColorSetRGB(0xdd, 0xdd, 0xdd); -const SkColor kFocusBorderColor = SkColorSetRGB(64, 128, 250); - const SkColor kHeaderTextColorNormal = SkColorSetARGB(0x7f, 0, 0, 0); const SkColor kHeaderTextColorHover = SkColorSetARGB(0xd3, 0, 0, 0); diff --git a/ash/system/tray/tray_constants.h b/ash/system/tray/tray_constants.h index 59caa87..e8cc74a 100644 --- a/ash/system/tray/tray_constants.h +++ b/ash/system/tray/tray_constants.h @@ -43,8 +43,6 @@ extern const SkColor kBorderDarkColor; extern const SkColor kBorderLightColor; extern const SkColor kButtonStrokeColor; -extern const SkColor kFocusBorderColor; - extern const SkColor kHeaderTextColorNormal; extern const SkColor kHeaderTextColorHover; diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc index 1e09eb1..ca3cce7 100644 --- a/ash/system/tray/tray_views.cc +++ b/ash/system/tray/tray_views.cc @@ -4,6 +4,7 @@ #include "ash/system/tray/tray_views.h" +#include "ash/ash_constants.h" #include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_item_view.h" #include "grit/ash_resources.h" |