| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_ACCESSIBILITY_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_ACCESSIBILITY_MENU_BUTTON_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_STATUS_ACCESSIBILITY_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_ACCESSIBILITY_MENU_BUTTON_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/chromeos/status/status_area_button.h" | 9 #include "chrome/browser/chromeos/status/status_area_button.h" |
| 10 #include "chrome/browser/prefs/pref_member.h" | 10 #include "chrome/browser/prefs/pref_member.h" |
| 11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "views/controls/menu/view_menu_delegate.h" | 12 #include "views/controls/menu/view_menu_delegate.h" |
| 13 #include "views/controls/menu/menu_delegate.h" | 13 #include "views/controls/menu/menu_delegate.h" |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 class MenuRunner; | 16 class MenuRunner; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 | 20 |
| 21 class StatusAreaHost; | |
| 22 | |
| 23 // A class for the button in the status area which alerts the user when | 21 // A class for the button in the status area which alerts the user when |
| 24 // accessibility features are enabled. | 22 // accessibility features are enabled. |
| 25 class AccessibilityMenuButton : public StatusAreaButton, | 23 class AccessibilityMenuButton : public StatusAreaButton, |
| 26 public views::ViewMenuDelegate, | 24 public views::ViewMenuDelegate, |
| 27 public views::MenuDelegate, | 25 public views::MenuDelegate, |
| 28 public content::NotificationObserver { | 26 public content::NotificationObserver { |
| 29 public: | 27 public: |
| 30 explicit AccessibilityMenuButton(StatusAreaHost* host); | 28 explicit AccessibilityMenuButton(StatusAreaButton::Delegate* delegate); |
| 31 virtual ~AccessibilityMenuButton(); | 29 virtual ~AccessibilityMenuButton(); |
| 32 | 30 |
| 33 // views::ViewMenuDelegate implementation | 31 // views::ViewMenuDelegate implementation |
| 34 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; | 32 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; |
| 35 | 33 |
| 36 // views::MenuDelegate implementation | 34 // views::MenuDelegate implementation |
| 37 virtual void ExecuteCommand(int id) OVERRIDE; | 35 virtual void ExecuteCommand(int id) OVERRIDE; |
| 38 | 36 |
| 39 // content::NotificationObserver implementation | 37 // content::NotificationObserver implementation |
| 40 virtual void Observe(int type, | 38 virtual void Observe(int type, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 53 BooleanPrefMember accessibility_enabled_; | 51 BooleanPrefMember accessibility_enabled_; |
| 54 // An object to show menu. | 52 // An object to show menu. |
| 55 scoped_ptr<views::MenuRunner> menu_runner_; | 53 scoped_ptr<views::MenuRunner> menu_runner_; |
| 56 | 54 |
| 57 DISALLOW_COPY_AND_ASSIGN(AccessibilityMenuButton); | 55 DISALLOW_COPY_AND_ASSIGN(AccessibilityMenuButton); |
| 58 }; | 56 }; |
| 59 | 57 |
| 60 } // namespace chromeos | 58 } // namespace chromeos |
| 61 | 59 |
| 62 #endif // CHROME_BROWSER_CHROMEOS_STATUS_ACCESSIBILITY_MENU_BUTTON_H_ | 60 #endif // CHROME_BROWSER_CHROMEOS_STATUS_ACCESSIBILITY_MENU_BUTTON_H_ |
| OLD | NEW |