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

Side by Side Diff: ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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/system/chromeos/power/power_status_view.cc ('k') | ash/system/drive/tray_drive.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h" 5 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h"
6 6
7 #include "ash/shelf/shelf_constants.h" 7 #include "ash/shelf/shelf_constants.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/status_area_widget.h" 9 #include "ash/system/status_area_widget.h"
10 #include "ash/system/tray/system_tray_notifier.h" 10 #include "ash/system/tray/system_tray_notifier.h"
(...skipping 10 matching lines...) Expand all
21 21
22 namespace ash { 22 namespace ash {
23 namespace { 23 namespace {
24 24
25 class VirtualKeyboardButton : public views::ImageButton { 25 class VirtualKeyboardButton : public views::ImageButton {
26 public: 26 public:
27 VirtualKeyboardButton(views::ButtonListener* listener); 27 VirtualKeyboardButton(views::ButtonListener* listener);
28 virtual ~VirtualKeyboardButton(); 28 virtual ~VirtualKeyboardButton();
29 29
30 // Overridden from views::ImageButton: 30 // Overridden from views::ImageButton:
31 virtual gfx::Size GetPreferredSize() OVERRIDE; 31 virtual gfx::Size GetPreferredSize() const OVERRIDE;
32 32
33 private: 33 private:
34 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardButton); 34 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardButton);
35 }; 35 };
36 36
37 VirtualKeyboardButton::VirtualKeyboardButton(views::ButtonListener* listener) 37 VirtualKeyboardButton::VirtualKeyboardButton(views::ButtonListener* listener)
38 : views::ImageButton(listener) { 38 : views::ImageButton(listener) {
39 } 39 }
40 40
41 VirtualKeyboardButton::~VirtualKeyboardButton() { 41 VirtualKeyboardButton::~VirtualKeyboardButton() {
42 } 42 }
43 43
44 gfx::Size VirtualKeyboardButton::GetPreferredSize() { 44 gfx::Size VirtualKeyboardButton::GetPreferredSize() const {
45 const int virtual_keyboard_button_height = kShelfSize; 45 const int virtual_keyboard_button_height = kShelfSize;
46 gfx::Size size = ImageButton::GetPreferredSize(); 46 gfx::Size size = ImageButton::GetPreferredSize();
47 int padding = virtual_keyboard_button_height - size.height(); 47 int padding = virtual_keyboard_button_height - size.height();
48 size.set_height(virtual_keyboard_button_height); 48 size.set_height(virtual_keyboard_button_height);
49 size.set_width(size.width() + padding); 49 size.set_width(size.width() + padding);
50 return size; 50 return size;
51 } 51 }
52 52
53 } // namespace 53 } // namespace
54 54
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 PerformAction(event); 109 PerformAction(event);
110 } 110 }
111 111
112 void VirtualKeyboardTray::OnAccessibilityModeChanged( 112 void VirtualKeyboardTray::OnAccessibilityModeChanged(
113 AccessibilityNotificationVisibility notify) { 113 AccessibilityNotificationVisibility notify) {
114 SetVisible(Shell::GetInstance()->accessibility_delegate()-> 114 SetVisible(Shell::GetInstance()->accessibility_delegate()->
115 IsVirtualKeyboardEnabled()); 115 IsVirtualKeyboardEnabled());
116 } 116 }
117 117
118 } // namespace ash 118 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/power_status_view.cc ('k') | ash/system/drive/tray_drive.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698