OLD | NEW |
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 "ui/message_center/views/message_center_button_bar.h" | 5 #include "ui/message_center/views/message_center_button_bar.h" |
6 | 6 |
7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/base/models/simple_menu_model.h" | 10 #include "ui/base/models/simple_menu_model.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 public: | 44 public: |
45 NotificationCenterButton(views::ButtonListener* listener, | 45 NotificationCenterButton(views::ButtonListener* listener, |
46 int normal_id, | 46 int normal_id, |
47 int hover_id, | 47 int hover_id, |
48 int pressed_id, | 48 int pressed_id, |
49 int text_id); | 49 int text_id); |
50 void set_size(gfx::Size size) { size_ = size; } | 50 void set_size(gfx::Size size) { size_ = size; } |
51 | 51 |
52 protected: | 52 protected: |
53 // Overridden from views::View: | 53 // Overridden from views::View: |
54 virtual gfx::Size GetPreferredSize() OVERRIDE; | 54 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
55 | 55 |
56 private: | 56 private: |
57 gfx::Size size_; | 57 gfx::Size size_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(NotificationCenterButton); | 59 DISALLOW_COPY_AND_ASSIGN(NotificationCenterButton); |
60 }; | 60 }; |
61 | 61 |
62 NotificationCenterButton::NotificationCenterButton( | 62 NotificationCenterButton::NotificationCenterButton( |
63 views::ButtonListener* listener, | 63 views::ButtonListener* listener, |
64 int normal_id, | 64 int normal_id, |
(...skipping 11 matching lines...) Expand all Loading... |
76 SetTooltipText(resource_bundle.GetLocalizedString(text_id)); | 76 SetTooltipText(resource_bundle.GetLocalizedString(text_id)); |
77 | 77 |
78 SetFocusable(true); | 78 SetFocusable(true); |
79 set_request_focus_on_press(false); | 79 set_request_focus_on_press(false); |
80 | 80 |
81 SetFocusPainter(views::Painter::CreateSolidFocusPainter( | 81 SetFocusPainter(views::Painter::CreateSolidFocusPainter( |
82 kFocusBorderColor, | 82 kFocusBorderColor, |
83 gfx::Insets(1, 2, 2, 2))); | 83 gfx::Insets(1, 2, 2, 2))); |
84 } | 84 } |
85 | 85 |
86 gfx::Size NotificationCenterButton::GetPreferredSize() { return size_; } | 86 gfx::Size NotificationCenterButton::GetPreferredSize() const { return size_; } |
87 | 87 |
88 // MessageCenterButtonBar ///////////////////////////////////////////////////// | 88 // MessageCenterButtonBar ///////////////////////////////////////////////////// |
89 /////////////////////////////////////////////////////////////////////////////// | 89 /////////////////////////////////////////////////////////////////////////////// |
90 MessageCenterButtonBar::MessageCenterButtonBar( | 90 MessageCenterButtonBar::MessageCenterButtonBar( |
91 MessageCenterView* message_center_view, | 91 MessageCenterView* message_center_view, |
92 MessageCenter* message_center, | 92 MessageCenter* message_center, |
93 NotifierSettingsProvider* notifier_settings_provider, | 93 NotifierSettingsProvider* notifier_settings_provider, |
94 bool settings_initially_visible) | 94 bool settings_initially_visible) |
95 : message_center_view_(message_center_view), | 95 : message_center_view_(message_center_view), |
96 message_center_(message_center), | 96 message_center_(message_center), |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 293 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
294 } else if (sender == close_bubble_button_) { | 294 } else if (sender == close_bubble_button_) { |
295 message_center_view()->tray()->HideMessageCenterBubble(); | 295 message_center_view()->tray()->HideMessageCenterBubble(); |
296 #endif | 296 #endif |
297 } else { | 297 } else { |
298 NOTREACHED(); | 298 NOTREACHED(); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 } // namespace message_center | 302 } // namespace message_center |
OLD | NEW |