OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/login/lock/screen_locker_tester.h" | 5 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // which can go away as a result of a successful authentication. As such, | 33 // which can go away as a result of a successful authentication. As such, |
34 // it needs to directly reference the global ScreenLocker. | 34 // it needs to directly reference the global ScreenLocker. |
35 class LoginAttemptObserver : public chromeos::AuthStatusConsumer { | 35 class LoginAttemptObserver : public chromeos::AuthStatusConsumer { |
36 public: | 36 public: |
37 LoginAttemptObserver(); | 37 LoginAttemptObserver(); |
38 virtual ~LoginAttemptObserver(); | 38 virtual ~LoginAttemptObserver(); |
39 | 39 |
40 void WaitForAttempt(); | 40 void WaitForAttempt(); |
41 | 41 |
42 // Overridden from AuthStatusConsumer: | 42 // Overridden from AuthStatusConsumer: |
43 virtual void OnAuthFailure(const chromeos::AuthFailure& error) OVERRIDE { | 43 virtual void OnAuthFailure(const chromeos::AuthFailure& error) override { |
44 LoginAttempted(); | 44 LoginAttempted(); |
45 } | 45 } |
46 | 46 |
47 virtual void OnAuthSuccess( | 47 virtual void OnAuthSuccess( |
48 const chromeos::UserContext& credentials) OVERRIDE { | 48 const chromeos::UserContext& credentials) override { |
49 LoginAttempted(); | 49 LoginAttempted(); |
50 } | 50 } |
51 | 51 |
52 private: | 52 private: |
53 void LoginAttempted(); | 53 void LoginAttempted(); |
54 | 54 |
55 bool login_attempted_; | 55 bool login_attempted_; |
56 bool waiting_; | 56 bool waiting_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(LoginAttemptObserver); | 58 DISALLOW_COPY_AND_ASSIGN(LoginAttemptObserver); |
(...skipping 28 matching lines...) Expand all Loading... |
87 | 87 |
88 } // anyonymous namespace | 88 } // anyonymous namespace |
89 | 89 |
90 namespace chromeos { | 90 namespace chromeos { |
91 | 91 |
92 namespace test { | 92 namespace test { |
93 | 93 |
94 class WebUIScreenLockerTester : public ScreenLockerTester { | 94 class WebUIScreenLockerTester : public ScreenLockerTester { |
95 public: | 95 public: |
96 // ScreenLockerTester overrides: | 96 // ScreenLockerTester overrides: |
97 virtual void SetPassword(const std::string& password) OVERRIDE; | 97 virtual void SetPassword(const std::string& password) override; |
98 virtual std::string GetPassword() OVERRIDE; | 98 virtual std::string GetPassword() override; |
99 virtual void EnterPassword(const std::string& password) OVERRIDE; | 99 virtual void EnterPassword(const std::string& password) override; |
100 virtual void EmulateWindowManagerReady() OVERRIDE; | 100 virtual void EmulateWindowManagerReady() override; |
101 virtual views::Widget* GetWidget() const OVERRIDE; | 101 virtual views::Widget* GetWidget() const override; |
102 virtual views::Widget* GetChildWidget() const OVERRIDE; | 102 virtual views::Widget* GetChildWidget() const override; |
103 | 103 |
104 private: | 104 private: |
105 friend class chromeos::ScreenLocker; | 105 friend class chromeos::ScreenLocker; |
106 | 106 |
107 WebUIScreenLockerTester() {} | 107 WebUIScreenLockerTester() {} |
108 | 108 |
109 content::RenderViewHost* RenderViewHost() const; | 109 content::RenderViewHost* RenderViewHost() const; |
110 | 110 |
111 // Returns the ScreenLockerWebUI object. | 111 // Returns the ScreenLockerWebUI object. |
112 WebUIScreenLocker* webui_screen_locker() const; | 112 WebUIScreenLocker* webui_screen_locker() const; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 new MockAuthenticator(ScreenLocker::screen_locker_, user_context)); | 207 new MockAuthenticator(ScreenLocker::screen_locker_, user_context)); |
208 } | 208 } |
209 | 209 |
210 } // namespace test | 210 } // namespace test |
211 | 211 |
212 test::ScreenLockerTester* ScreenLocker::GetTester() { | 212 test::ScreenLockerTester* ScreenLocker::GetTester() { |
213 return new test::WebUIScreenLockerTester(); | 213 return new test::WebUIScreenLockerTester(); |
214 } | 214 } |
215 | 215 |
216 } // namespace chromeos | 216 } // namespace chromeos |
OLD | NEW |