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

Side by Side Diff: ash/shelf/overflow_button.cc

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shelf/overflow_button.h" 5 #include "ash/shelf/overflow_button.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shelf/shelf.h" 8 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_widget.h" 10 #include "ash/shelf/shelf_widget.h"
(...skipping 22 matching lines...) Expand all
33 33
34 const int kBackgroundOffset = (48 - kButtonHoverSize) / 2; 34 const int kBackgroundOffset = (48 - kButtonHoverSize) / 2;
35 35
36 } // namesapce 36 } // namesapce
37 37
38 OverflowButton::OverflowButton(views::ButtonListener* listener, Shelf* shelf) 38 OverflowButton::OverflowButton(views::ButtonListener* listener, Shelf* shelf)
39 : CustomButton(listener), bottom_image_(nullptr), shelf_(shelf) { 39 : CustomButton(listener), bottom_image_(nullptr), shelf_(shelf) {
40 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); 40 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
41 bottom_image_ = rb->GetImageNamed(IDR_ASH_SHELF_OVERFLOW).ToImageSkia(); 41 bottom_image_ = rb->GetImageNamed(IDR_ASH_SHELF_OVERFLOW).ToImageSkia();
42 42
43 SetAccessibilityFocusable(true); 43 SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY);
44 SetAccessibleName(l10n_util::GetStringUTF16(IDS_ASH_SHELF_OVERFLOW_NAME)); 44 SetAccessibleName(l10n_util::GetStringUTF16(IDS_ASH_SHELF_OVERFLOW_NAME));
45 } 45 }
46 46
47 OverflowButton::~OverflowButton() {} 47 OverflowButton::~OverflowButton() {}
48 48
49 void OverflowButton::OnShelfAlignmentChanged() { 49 void OverflowButton::OnShelfAlignmentChanged() {
50 SchedulePaint(); 50 SchedulePaint();
51 } 51 }
52 52
53 void OverflowButton::PaintBackground(gfx::Canvas* canvas, int alpha) { 53 void OverflowButton::PaintBackground(gfx::Canvas* canvas, int alpha) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 image = bottom_image_; 136 image = bottom_image_;
137 break; 137 break;
138 } 138 }
139 139
140 canvas->DrawImageInt(*image, 140 canvas->DrawImageInt(*image,
141 bounds.x() + ((bounds.width() - image->width()) / 2), 141 bounds.x() + ((bounds.width() - image->width()) / 2),
142 bounds.y() + ((bounds.height() - image->height()) / 2)); 142 bounds.y() + ((bounds.height() - image->height()) / 2));
143 } 143 }
144 144
145 } // namespace ash 145 } // namespace ash
OLDNEW
« no previous file with comments | « ash/focus_cycler_unittest.cc ('k') | ash/shelf/shelf_button.cc » ('j') | ui/views/view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698