| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 static const char kViewClassName[]; | 55 static const char kViewClassName[]; |
| 56 | 56 |
| 57 WebUILoginView(); | 57 WebUILoginView(); |
| 58 virtual ~WebUILoginView(); | 58 virtual ~WebUILoginView(); |
| 59 | 59 |
| 60 // Initializes the webui login view. | 60 // Initializes the webui login view. |
| 61 virtual void Init(); | 61 virtual void Init(); |
| 62 | 62 |
| 63 // Overridden from views::View: | 63 // Overridden from views::View: |
| 64 virtual bool AcceleratorPressed( | 64 virtual bool AcceleratorPressed( |
| 65 const ui::Accelerator& accelerator) OVERRIDE; | 65 const ui::Accelerator& accelerator) override; |
| 66 virtual const char* GetClassName() const OVERRIDE; | 66 virtual const char* GetClassName() const override; |
| 67 virtual void RequestFocus() OVERRIDE; | 67 virtual void RequestFocus() override; |
| 68 | 68 |
| 69 // Overridden from ChromeWebModalDialogManagerDelegate: | 69 // Overridden from ChromeWebModalDialogManagerDelegate: |
| 70 virtual web_modal::WebContentsModalDialogHost* | 70 virtual web_modal::WebContentsModalDialogHost* |
| 71 GetWebContentsModalDialogHost() OVERRIDE; | 71 GetWebContentsModalDialogHost() override; |
| 72 | 72 |
| 73 // Overridden from web_modal::WebContentsModalDialogHost: | 73 // Overridden from web_modal::WebContentsModalDialogHost: |
| 74 virtual gfx::NativeView GetHostView() const OVERRIDE; | 74 virtual gfx::NativeView GetHostView() const override; |
| 75 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; | 75 virtual gfx::Point GetDialogPosition(const gfx::Size& size) override; |
| 76 virtual gfx::Size GetMaximumDialogSize() OVERRIDE; | 76 virtual gfx::Size GetMaximumDialogSize() override; |
| 77 virtual void AddObserver( | 77 virtual void AddObserver( |
| 78 web_modal::ModalDialogHostObserver* observer) OVERRIDE; | 78 web_modal::ModalDialogHostObserver* observer) override; |
| 79 virtual void RemoveObserver( | 79 virtual void RemoveObserver( |
| 80 web_modal::ModalDialogHostObserver* observer) OVERRIDE; | 80 web_modal::ModalDialogHostObserver* observer) override; |
| 81 | 81 |
| 82 // Gets the native window from the view widget. | 82 // Gets the native window from the view widget. |
| 83 gfx::NativeWindow GetNativeWindow() const; | 83 gfx::NativeWindow GetNativeWindow() const; |
| 84 | 84 |
| 85 // Loads given page. Should be called after Init() has been called. | 85 // Loads given page. Should be called after Init() has been called. |
| 86 void LoadURL(const GURL& url); | 86 void LoadURL(const GURL& url); |
| 87 | 87 |
| 88 // Returns current WebUI. | 88 // Returns current WebUI. |
| 89 content::WebUI* GetWebUI(); | 89 content::WebUI* GetWebUI(); |
| 90 | 90 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 110 // Let suppress emission of this signal. | 110 // Let suppress emission of this signal. |
| 111 void set_should_emit_login_prompt_visible(bool emit) { | 111 void set_should_emit_login_prompt_visible(bool emit) { |
| 112 should_emit_login_prompt_visible_ = emit; | 112 should_emit_login_prompt_visible_ = emit; |
| 113 } | 113 } |
| 114 | 114 |
| 115 void AddFrameObserver(FrameObserver* frame_observer); | 115 void AddFrameObserver(FrameObserver* frame_observer); |
| 116 void RemoveFrameObserver(FrameObserver* frame_observer); | 116 void RemoveFrameObserver(FrameObserver* frame_observer); |
| 117 | 117 |
| 118 protected: | 118 protected: |
| 119 // Overridden from views::View: | 119 // Overridden from views::View: |
| 120 virtual void Layout() OVERRIDE; | 120 virtual void Layout() override; |
| 121 virtual void OnLocaleChanged() OVERRIDE; | 121 virtual void OnLocaleChanged() override; |
| 122 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; | 122 virtual void ChildPreferredSizeChanged(View* child) override; |
| 123 virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE; | 123 virtual void AboutToRequestFocusFromTabTraversal(bool reverse) override; |
| 124 | 124 |
| 125 // Overridden from content::NotificationObserver. | 125 // Overridden from content::NotificationObserver. |
| 126 virtual void Observe(int type, | 126 virtual void Observe(int type, |
| 127 const content::NotificationSource& source, | 127 const content::NotificationSource& source, |
| 128 const content::NotificationDetails& details) OVERRIDE; | 128 const content::NotificationDetails& details) override; |
| 129 | 129 |
| 130 // WebView for rendering a webpage as a webui login. | 130 // WebView for rendering a webpage as a webui login. |
| 131 views::WebView* webui_login_; | 131 views::WebView* webui_login_; |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 // Map type for the accelerator-to-identifier map. | 134 // Map type for the accelerator-to-identifier map. |
| 135 typedef std::map<ui::Accelerator, std::string> AccelMap; | 135 typedef std::map<ui::Accelerator, std::string> AccelMap; |
| 136 | 136 |
| 137 // Overridden from content::WebContentsDelegate. | 137 // Overridden from content::WebContentsDelegate. |
| 138 virtual bool HandleContextMenu( | 138 virtual bool HandleContextMenu( |
| 139 const content::ContextMenuParams& params) OVERRIDE; | 139 const content::ContextMenuParams& params) override; |
| 140 virtual void HandleKeyboardEvent( | 140 virtual void HandleKeyboardEvent( |
| 141 content::WebContents* source, | 141 content::WebContents* source, |
| 142 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 142 const content::NativeWebKeyboardEvent& event) override; |
| 143 virtual bool IsPopupOrPanel( | 143 virtual bool IsPopupOrPanel( |
| 144 const content::WebContents* source) const OVERRIDE; | 144 const content::WebContents* source) const override; |
| 145 virtual bool TakeFocus(content::WebContents* source, bool reverse) OVERRIDE; | 145 virtual bool TakeFocus(content::WebContents* source, bool reverse) override; |
| 146 virtual void RequestMediaAccessPermission( | 146 virtual void RequestMediaAccessPermission( |
| 147 content::WebContents* web_contents, | 147 content::WebContents* web_contents, |
| 148 const content::MediaStreamRequest& request, | 148 const content::MediaStreamRequest& request, |
| 149 const content::MediaResponseCallback& callback) OVERRIDE; | 149 const content::MediaResponseCallback& callback) override; |
| 150 virtual bool CheckMediaAccessPermission( | 150 virtual bool CheckMediaAccessPermission( |
| 151 content::WebContents* web_contents, | 151 content::WebContents* web_contents, |
| 152 const GURL& security_origin, | 152 const GURL& security_origin, |
| 153 content::MediaStreamType type) OVERRIDE; | 153 content::MediaStreamType type) override; |
| 154 virtual bool PreHandleGestureEvent( | 154 virtual bool PreHandleGestureEvent( |
| 155 content::WebContents* source, | 155 content::WebContents* source, |
| 156 const blink::WebGestureEvent& event) OVERRIDE; | 156 const blink::WebGestureEvent& event) override; |
| 157 | 157 |
| 158 // Overridden from content::WebContentsObserver. | 158 // Overridden from content::WebContentsObserver. |
| 159 virtual void DidFailProvisionalLoad( | 159 virtual void DidFailProvisionalLoad( |
| 160 content::RenderFrameHost* render_frame_host, | 160 content::RenderFrameHost* render_frame_host, |
| 161 const GURL& validated_url, | 161 const GURL& validated_url, |
| 162 int error_code, | 162 int error_code, |
| 163 const base::string16& error_description) OVERRIDE; | 163 const base::string16& error_description) override; |
| 164 | 164 |
| 165 // Performs series of actions when login prompt is considered | 165 // Performs series of actions when login prompt is considered |
| 166 // to be ready and visible. | 166 // to be ready and visible. |
| 167 // 1. Emits LoginPromptVisible signal if needed | 167 // 1. Emits LoginPromptVisible signal if needed |
| 168 // 2. Notifies OOBE/sign classes. | 168 // 2. Notifies OOBE/sign classes. |
| 169 void OnLoginPromptVisible(); | 169 void OnLoginPromptVisible(); |
| 170 | 170 |
| 171 // Called when focus is returned from status area. | 171 // Called when focus is returned from status area. |
| 172 // |reverse| is true when focus is traversed backwards (using Shift-Tab). | 172 // |reverse| is true when focus is traversed backwards (using Shift-Tab). |
| 173 void ReturnFocus(bool reverse); | 173 void ReturnFocus(bool reverse); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 202 // TODO(gbillock): See if we can get rid of this. Perhaps in favor of | 202 // TODO(gbillock): See if we can get rid of this. Perhaps in favor of |
| 203 // in-content styled popups or something? There oughtta be a way... | 203 // in-content styled popups or something? There oughtta be a way... |
| 204 scoped_ptr<web_modal::PopupManager> popup_manager_; | 204 scoped_ptr<web_modal::PopupManager> popup_manager_; |
| 205 | 205 |
| 206 DISALLOW_COPY_AND_ASSIGN(WebUILoginView); | 206 DISALLOW_COPY_AND_ASSIGN(WebUILoginView); |
| 207 }; | 207 }; |
| 208 | 208 |
| 209 } // namespace chromeos | 209 } // namespace chromeos |
| 210 | 210 |
| 211 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ | 211 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ |
| OLD | NEW |