| 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_LOGIN_SCREEN_LOCKER_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_VIEWS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_VIEWS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_VIEWS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/chromeos/login/captcha_view.h" | 9 #include "chrome/browser/chromeos/login/captcha_view.h" |
| 10 #include "chrome/browser/chromeos/login/message_bubble.h" | 10 #include "chrome/browser/chromeos/login/message_bubble.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class ScreenLockView; | 21 class ScreenLockView; |
| 22 | 22 |
| 23 namespace test { | 23 namespace test { |
| 24 class ScreenLockerTester; | 24 class ScreenLockerTester; |
| 25 } | 25 } |
| 26 | 26 |
| 27 // This version of ScreenLockerDelegate displays a views interface. This class | 27 // This version of ScreenLockerDelegate displays a views interface. This class |
| 28 // shows a BackgroundView and a Signout button as well as creating a | 28 // shows a BackgroundView and a Signout button as well as creating a |
| 29 // ScreenLockView to allow the user to log in. | 29 // ScreenLockView to allow the user to log in. |
| 30 class ScreenLockerViews : public ScreenLockerDelegate, | 30 class ScreenLockerViews : public ScreenLockerDelegate, |
| 31 public MessageBubbleDelegate, | |
| 32 public CaptchaView::Delegate, | 31 public CaptchaView::Delegate, |
| 33 public ui::AcceleratorTarget { | 32 public ui::AcceleratorTarget, |
| 33 public views::Widget::Observer { |
| 34 public: | 34 public: |
| 35 // Interface that helps switching from ScreenLockView to CaptchaView. | 35 // Interface that helps switching from ScreenLockView to CaptchaView. |
| 36 class ScreenLockViewContainer { | 36 class ScreenLockViewContainer { |
| 37 public: | 37 public: |
| 38 virtual void SetScreenLockView(views::View* screen_lock_view) = 0; | 38 virtual void SetScreenLockView(views::View* screen_lock_view) = 0; |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 virtual ~ScreenLockViewContainer(); | 41 virtual ~ScreenLockViewContainer(); |
| 42 }; | 42 }; |
| 43 | 43 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 60 virtual void ScreenLockReady() OVERRIDE; | 60 virtual void ScreenLockReady() OVERRIDE; |
| 61 virtual void OnAuthenticate() OVERRIDE; | 61 virtual void OnAuthenticate() OVERRIDE; |
| 62 virtual void SetInputEnabled(bool enabled) OVERRIDE; | 62 virtual void SetInputEnabled(bool enabled) OVERRIDE; |
| 63 virtual void SetSignoutEnabled(bool enabled) OVERRIDE; | 63 virtual void SetSignoutEnabled(bool enabled) OVERRIDE; |
| 64 virtual void ShowErrorMessage(const string16& message, | 64 virtual void ShowErrorMessage(const string16& message, |
| 65 bool sign_out_only) OVERRIDE; | 65 bool sign_out_only) OVERRIDE; |
| 66 virtual void ShowCaptchaAndErrorMessage(const GURL& captcha_url, | 66 virtual void ShowCaptchaAndErrorMessage(const GURL& captcha_url, |
| 67 const string16& message) OVERRIDE; | 67 const string16& message) OVERRIDE; |
| 68 virtual void ClearErrors() OVERRIDE; | 68 virtual void ClearErrors() OVERRIDE; |
| 69 | 69 |
| 70 // Overridden from views::BubbleDelegate. | 70 // views::Widget::Observer implementation: |
| 71 virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE; | 71 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
| 72 virtual bool CloseOnEscape() OVERRIDE; | |
| 73 virtual bool FadeInOnShow() OVERRIDE; | |
| 74 virtual void OnLinkActivated(size_t index) OVERRIDE; | |
| 75 | 72 |
| 76 // CaptchaView::Delegate implementation: | 73 // CaptchaView::Delegate implementation: |
| 77 virtual void OnCaptchaEntered(const std::string& captcha) OVERRIDE; | 74 virtual void OnCaptchaEntered(const std::string& captcha) OVERRIDE; |
| 78 | 75 |
| 76 // Called when the window manager is ready to handle locked state. |
| 77 void OnWindowManagerReady(); |
| 78 |
| 79 private: | 79 private: |
| 80 friend class LockerInputEventObserver; | 80 friend class LockerInputEventObserver; |
| 81 friend class test::ScreenLockerTester; | 81 friend class test::ScreenLockerTester; |
| 82 | 82 |
| 83 virtual ~ScreenLockerViews(); | 83 virtual ~ScreenLockerViews(); |
| 84 | 84 |
| 85 // Called when the window manager is ready to handle locked state. | |
| 86 void OnWindowManagerReady(); | |
| 87 | |
| 88 // Shows error_info_ bubble with the |message| and |arrow_location| specified. | 85 // Shows error_info_ bubble with the |message| and |arrow_location| specified. |
| 89 // Assumes that UI controls were locked before that. | 86 // Assumes that UI controls were locked before that. |
| 90 void ShowErrorBubble(const string16& message, | 87 void ShowErrorBubble(const string16& message, |
| 91 views::BubbleBorder::ArrowLocation arrow_location); | 88 views::BubbleBorder::ArrowLocation arrow_location); |
| 92 | 89 |
| 93 // Overridden from ui::AcceleratorTarget: | 90 // Overridden from ui::AcceleratorTarget: |
| 94 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 91 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
| 95 | 92 |
| 96 // Event handler for client-event. | |
| 97 CHROMEGTK_CALLBACK_1(ScreenLockerViews, void, OnClientEvent, GdkEventClient*); | |
| 98 | |
| 99 // The screen locker window. | 93 // The screen locker window. |
| 100 views::Widget* lock_window_; | 94 views::Widget* lock_window_; |
| 101 | 95 |
| 102 // Child widget to grab the keyboard/mouse input. | 96 // Child widget to grab the keyboard/mouse input. |
| 103 views::Widget* lock_widget_; | 97 views::Widget* lock_widget_; |
| 104 | 98 |
| 105 // A view that accepts password. | 99 // A view that accepts password. |
| 106 ScreenLockView* screen_lock_view_; | 100 ScreenLockView* screen_lock_view_; |
| 107 | 101 |
| 108 // A view that can display html page as background. | 102 // A view that can display html page as background. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 141 |
| 148 // True if both mouse input and keyboard input are grabbed. | 142 // True if both mouse input and keyboard input are grabbed. |
| 149 bool input_grabbed_; | 143 bool input_grabbed_; |
| 150 | 144 |
| 151 DISALLOW_COPY_AND_ASSIGN(ScreenLockerViews); | 145 DISALLOW_COPY_AND_ASSIGN(ScreenLockerViews); |
| 152 }; | 146 }; |
| 153 | 147 |
| 154 } // namespace chromeos | 148 } // namespace chromeos |
| 155 | 149 |
| 156 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_VIEWS_H_ | 150 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_VIEWS_H_ |
| OLD | NEW |