Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1666)

Unified Diff: ash/launcher/launcher_view.cc

Issue 11306012: Use the same blue solid border among tray and launcher, for focus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash_constants.cc ('k') | ash/system/audio/tray_volume.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher_view.cc
diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc
index c5044ad5c9a57078f92217dfa6aad4decff7caef..12f689e6c471733fa5b010a4bc0798982cacbb6f 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);
« no previous file with comments | « ash/ash_constants.cc ('k') | ash/system/audio/tray_volume.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698