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

Side by Side Diff: ash/launcher/app_launcher_button.cc

Issue 9406031: Makes it so the launcher only gets focus when using the keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/focus_cycler.cc ('k') | ash/launcher/launcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/launcher/app_launcher_button.h" 5 #include "ash/launcher/app_launcher_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/launcher/launcher_button_host.h" 9 #include "ash/launcher/launcher_button_host.h"
10 #include "ui/base/accessibility/accessible_view_state.h" 10 #include "ui/base/accessibility/accessible_view_state.h"
11 #include "ui/gfx/canvas_skia.h" 11 #include "ui/gfx/canvas_skia.h"
12 12
13 namespace ash { 13 namespace ash {
14 14
15 namespace internal { 15 namespace internal {
16 16
17 const int kImageSize = 32; 17 const int kImageSize = 32;
18 18
19 AppLauncherButton::AppLauncherButton(views::ButtonListener* listener, 19 AppLauncherButton::AppLauncherButton(views::ButtonListener* listener,
20 LauncherButtonHost* host) 20 LauncherButtonHost* host)
21 : views::ImageButton(listener), 21 : views::ImageButton(listener),
22 host_(host) { 22 host_(host) {
23 SetImageAlignment(views::ImageButton::ALIGN_CENTER, 23 SetImageAlignment(views::ImageButton::ALIGN_CENTER,
24 views::ImageButton::ALIGN_MIDDLE); 24 views::ImageButton::ALIGN_MIDDLE);
25 set_focusable(true); 25 set_accessibility_focusable(true);
26 } 26 }
27 27
28 AppLauncherButton::~AppLauncherButton() { 28 AppLauncherButton::~AppLauncherButton() {
29 } 29 }
30 30
31 void AppLauncherButton::SetAppImage(const SkBitmap& image) { 31 void AppLauncherButton::SetAppImage(const SkBitmap& image) {
32 if (image.empty()) { 32 if (image.empty()) {
33 // TODO: need an empty image. 33 // TODO: need an empty image.
34 SetImage(BS_NORMAL, &image); 34 SetImage(BS_NORMAL, &image);
35 return; 35 return;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 host_->MouseExitedButton(this); 82 host_->MouseExitedButton(this);
83 } 83 }
84 84
85 void AppLauncherButton::GetAccessibleState(ui::AccessibleViewState* state) { 85 void AppLauncherButton::GetAccessibleState(ui::AccessibleViewState* state) {
86 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; 86 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
87 state->name = host_->GetAccessibleName(this); 87 state->name = host_->GetAccessibleName(this);
88 } 88 }
89 89
90 } // namespace internal 90 } // namespace internal
91 } // namespace ash 91 } // namespace ash
OLDNEW
« no previous file with comments | « ash/focus_cycler.cc ('k') | ash/launcher/launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698