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

Unified Diff: chrome/browser/chromeos/status/accessibility_menu_button.h

Issue 7753029: Add a button on status bar to indicate that accessibility is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed files already committed in advance Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/status/accessibility_menu_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/status/accessibility_menu_button.h
diff --git a/chrome/browser/chromeos/status/accessibility_menu_button.h b/chrome/browser/chromeos/status/accessibility_menu_button.h
new file mode 100644
index 0000000000000000000000000000000000000000..36988cafcdc0e4920adcd25c16d2911e1768bdda
--- /dev/null
+++ b/chrome/browser/chromeos/status/accessibility_menu_button.h
@@ -0,0 +1,62 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_STATUS_ACCESSIBILITY_MENU_BUTTON_H_
+#define CHROME_BROWSER_CHROMEOS_STATUS_ACCESSIBILITY_MENU_BUTTON_H_
+#pragma once
+
+#include "chrome/browser/chromeos/status/status_area_button.h"
+#include "chrome/browser/prefs/pref_member.h"
+#include "content/common/notification_observer.h"
+#include "views/controls/menu/view_menu_delegate.h"
+#include "views/controls/menu/menu_delegate.h"
+
+namespace views {
+class MenuRunner;
+}
+
+namespace chromeos {
+
+class StatusAreaHost;
+
+// A class for the button in the status area which alerts the user when
+// accessibility features are enabled.
+class AccessibilityMenuButton : public StatusAreaButton,
+ public views::ViewMenuDelegate,
+ public views::MenuDelegate,
+ public NotificationObserver {
+ public:
+ explicit AccessibilityMenuButton(StatusAreaHost* host);
+ virtual ~AccessibilityMenuButton();
+
+ // views::ViewMenuDelegate implementation
+ virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE;
+
+ // views::MenuDelegate implementation
+ virtual void ExecuteCommand(int id) OVERRIDE;
+
+ // NotificationObserver implementation
+ virtual void Observe(int type,
+ const NotificationSource& source,
+ const NotificationDetails& details) OVERRIDE;
+
+ private:
+ // Updates the state along with the preferences.
+ void Update();
+
+ // Prepares menu before showing it.
+ void PrepareMenu();
+
+ // An object synced to the preference, representing if accessibility feature
+ // is enabled or not.
+ BooleanPrefMember accessibility_enabled_;
+ // An object to show menu.
+ scoped_ptr<views::MenuRunner> menu_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(AccessibilityMenuButton);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_STATUS_ACCESSIBILITY_MENU_BUTTON_H_
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/status/accessibility_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698