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

Unified Diff: chrome/browser/chromeos/ui/password_echo_controller.h

Issue 2279163002: cros: Bind password echo with TouchView mode
Patch Set: do not run for mash to fix mash test Created 4 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
Index: chrome/browser/chromeos/ui/password_echo_controller.h
diff --git a/chrome/browser/chromeos/ui/password_echo_controller.h b/chrome/browser/chromeos/ui/password_echo_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..1c53962782a8189e0a2fffee6398143fdd13b4d6
--- /dev/null
+++ b/chrome/browser/chromeos/ui/password_echo_controller.h
@@ -0,0 +1,42 @@
+// Copyright 2016 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_UI_PASSWORD_ECHO_CONTROLLER_H_
+#define CHROME_BROWSER_CHROMEOS_UI_PASSWORD_ECHO_CONTROLLER_H_
+
+#include "ash/common/shell_observer.h"
+#include "base/macros.h"
+
+namespace chromeos {
+
+// Manages password echo behavior for renderers and TextFields. The current
+// behavior is to enable password echo when TouchView mode is on and disable
+// it when TouchView mode is off.
+class PasswordEchoController : ash::ShellObserver {
+ public:
+ PasswordEchoController();
+ ~PasswordEchoController() override;
+
+ // Gets the current instance. Returns nullptr if there is no current instance.
+ static PasswordEchoController* Get();
+
+ bool enabled() const { return enabled_; }
+
+ private:
+ void SetEnabled(bool enabled);
+ void UpdateWebkitPreferences();
+
+ // ash::ShellObserver
+ void OnMaximizeModeStarted() override;
+ void OnMaximizeModeEnded() override;
+
+ // Whether password echo is enabled.
+ bool enabled_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(PasswordEchoController);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_UI_PASSWORD_ECHO_CONTROLLER_H_
« no previous file with comments | « chrome/browser/chromeos/chrome_browser_main_chromeos.cc ('k') | chrome/browser/chromeos/ui/password_echo_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698