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

Unified Diff: chrome/browser/ui/views/aura/caps_lock_handler.h

Issue 9225004: Handle Caps Lock short cut (Shift+Search) in ash [part 2 of 2]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 11 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
Index: chrome/browser/ui/views/aura/caps_lock_handler.h
diff --git a/chrome/browser/ui/views/aura/caps_lock_handler.h b/chrome/browser/ui/views/aura/caps_lock_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed6d09ea867e88d7e210932eaa7ab861f7227f5d
--- /dev/null
+++ b/chrome/browser/ui/views/aura/caps_lock_handler.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2012 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_UI_VIEWS_AURA_CAPS_LOCK_HANDLER_H_
+#define CHROME_BROWSER_UI_VIEWS_AURA_CAPS_LOCK_HANDLER_H_
+#pragma once
+
+#include "ash/caps_lock_delegate.h"
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/system_key_event_listener.h"
+#endif
+
+class CapsLockHandler
Daniel Erat 2012/01/18 15:44:31 nit: add a brief comment describing what this clas
Yusuke Sato 2012/01/23 06:53:49 Done.
+ : public ash::CapsLockDelegate
+#if defined(OS_CHROMEOS)
+ , public chromeos::SystemKeyEventListener::CapsLockObserver
+#endif
+{
+ public:
+ CapsLockHandler();
+ virtual ~CapsLockHandler();
+
+ // Overridden from ash::CapsLockHandler:
+ virtual bool HandleToggleCapsLock() OVERRIDE;
+
+#if defined(OS_CHROMEOS)
+ // Overridden from chromeos::SystemKeyEventListener::CapsLockObserver:
+ virtual void OnCapsLockChange(bool enabled) OVERRIDE;
+#endif
+
+ protected:
+ // For testing.
+ void set_is_running_on_chromeos(bool is_running_on_chromeos) {
Daniel Erat 2012/01/18 15:44:31 nit: add "_for_test" at the end of this method's n
Yusuke Sato 2012/01/23 06:53:49 Thanks. Removed the derived class as well.
+ is_running_on_chromeos_ = is_running_on_chromeos;
+ }
+ // For testing.
+ bool caps_lock_is_on() const {
+ return caps_lock_is_on_;
+ }
+
+ private:
+ bool is_running_on_chromeos_;
+ bool caps_lock_is_on_;
+
+ DISALLOW_COPY_AND_ASSIGN(CapsLockHandler);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_AURA_CAPS_LOCK_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698