| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/notifier_settings_view.h" | 5 #include "ui/message_center/views/notifier_settings_view.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // EntryView ------------------------------------------------------------------ | 122 // EntryView ------------------------------------------------------------------ |
| 123 | 123 |
| 124 // The view to guarantee the 48px height and place the contents at the | 124 // The view to guarantee the 48px height and place the contents at the |
| 125 // middle. It also guarantee the left margin. | 125 // middle. It also guarantee the left margin. |
| 126 class EntryView : public views::View { | 126 class EntryView : public views::View { |
| 127 public: | 127 public: |
| 128 explicit EntryView(views::View* contents); | 128 explicit EntryView(views::View* contents); |
| 129 virtual ~EntryView(); | 129 virtual ~EntryView(); |
| 130 | 130 |
| 131 // views::View: | 131 // views::View: |
| 132 virtual void Layout() OVERRIDE; | 132 virtual void Layout() override; |
| 133 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 133 virtual gfx::Size GetPreferredSize() const override; |
| 134 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 134 virtual void GetAccessibleState(ui::AXViewState* state) override; |
| 135 virtual void OnFocus() OVERRIDE; | 135 virtual void OnFocus() override; |
| 136 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 136 virtual bool OnKeyPressed(const ui::KeyEvent& event) override; |
| 137 virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE; | 137 virtual bool OnKeyReleased(const ui::KeyEvent& event) override; |
| 138 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 138 virtual void OnPaint(gfx::Canvas* canvas) override; |
| 139 virtual void OnBlur() OVERRIDE; | 139 virtual void OnBlur() override; |
| 140 | 140 |
| 141 private: | 141 private: |
| 142 scoped_ptr<views::Painter> focus_painter_; | 142 scoped_ptr<views::Painter> focus_painter_; |
| 143 | 143 |
| 144 DISALLOW_COPY_AND_ASSIGN(EntryView); | 144 DISALLOW_COPY_AND_ASSIGN(EntryView); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 EntryView::EntryView(views::View* contents) | 147 EntryView::EntryView(views::View* contents) |
| 148 : focus_painter_(CreateFocusPainter()) { | 148 : focus_painter_(CreateFocusPainter()) { |
| 149 AddChildView(contents); | 149 AddChildView(contents); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 // NotifierGroupMenuModel ----------------------------------------------------- | 204 // NotifierGroupMenuModel ----------------------------------------------------- |
| 205 | 205 |
| 206 class NotifierGroupMenuModel : public ui::SimpleMenuModel, | 206 class NotifierGroupMenuModel : public ui::SimpleMenuModel, |
| 207 public ui::SimpleMenuModel::Delegate { | 207 public ui::SimpleMenuModel::Delegate { |
| 208 public: | 208 public: |
| 209 NotifierGroupMenuModel(NotifierSettingsProvider* notifier_settings_provider); | 209 NotifierGroupMenuModel(NotifierSettingsProvider* notifier_settings_provider); |
| 210 virtual ~NotifierGroupMenuModel(); | 210 virtual ~NotifierGroupMenuModel(); |
| 211 | 211 |
| 212 // ui::SimpleMenuModel::Delegate: | 212 // ui::SimpleMenuModel::Delegate: |
| 213 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 213 virtual bool IsCommandIdChecked(int command_id) const override; |
| 214 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 214 virtual bool IsCommandIdEnabled(int command_id) const override; |
| 215 virtual bool GetAcceleratorForCommandId( | 215 virtual bool GetAcceleratorForCommandId( |
| 216 int command_id, | 216 int command_id, |
| 217 ui::Accelerator* accelerator) OVERRIDE; | 217 ui::Accelerator* accelerator) override; |
| 218 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 218 virtual void ExecuteCommand(int command_id, int event_flags) override; |
| 219 | 219 |
| 220 private: | 220 private: |
| 221 NotifierSettingsProvider* notifier_settings_provider_; | 221 NotifierSettingsProvider* notifier_settings_provider_; |
| 222 | 222 |
| 223 DISALLOW_COPY_AND_ASSIGN(NotifierGroupMenuModel); | 223 DISALLOW_COPY_AND_ASSIGN(NotifierGroupMenuModel); |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 NotifierGroupMenuModel::NotifierGroupMenuModel( | 226 NotifierGroupMenuModel::NotifierGroupMenuModel( |
| 227 NotifierSettingsProvider* notifier_settings_provider) | 227 NotifierSettingsProvider* notifier_settings_provider) |
| 228 : ui::SimpleMenuModel(this), | 228 : ui::SimpleMenuModel(this), |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 notifier_group_selector_, | 696 notifier_group_selector_, |
| 697 menu_anchor, | 697 menu_anchor, |
| 698 views::MENU_ANCHOR_BUBBLE_ABOVE, | 698 views::MENU_ANCHOR_BUBBLE_ABOVE, |
| 699 ui::MENU_SOURCE_MOUSE)) | 699 ui::MENU_SOURCE_MOUSE)) |
| 700 return; | 700 return; |
| 701 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); | 701 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); |
| 702 center_view->OnSettingsChanged(); | 702 center_view->OnSettingsChanged(); |
| 703 } | 703 } |
| 704 | 704 |
| 705 } // namespace message_center | 705 } // namespace message_center |
| OLD | NEW |