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

Side by Side Diff: chrome/browser/chromeos/login/webui_login_view.h

Issue 8438064: Separate StatusAreaView from StatusAreaViewChromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_WEBUI_LOGIN_VIEW_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WEBUI_LOGIN_VIEW_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WEBUI_LOGIN_VIEW_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WEBUI_LOGIN_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/chromeos/login/login_html_dialog.h" 9 #include "chrome/browser/chromeos/login/login_html_dialog.h"
10 #include "chrome/browser/chromeos/status/status_area_host.h" 10 #include "chrome/browser/chromeos/status/status_area_button.h"
11 #include "chrome/browser/chromeos/tab_first_render_watcher.h" 11 #include "chrome/browser/chromeos/tab_first_render_watcher.h"
12 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" 12 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h"
13 #include "content/browser/tab_contents/tab_contents_delegate.h" 13 #include "content/browser/tab_contents/tab_contents_delegate.h"
14 #include "views/widget/widget_delegate.h" 14 #include "views/widget/widget_delegate.h"
15 15
16 class DOMView; 16 class DOMView;
17 class GURL; 17 class GURL;
18 class Profile; 18 class Profile;
19 class WebUI; 19 class WebUI;
20 20
21 namespace views { 21 namespace views {
22 class View; 22 class View;
23 class Widget; 23 class Widget;
24 } 24 }
25 25
26 namespace chromeos { 26 namespace chromeos {
27 27
28 class StatusAreaView; 28 class StatusAreaViewChromeos;
29 class TabFirstRenderWatcher; 29 class TabFirstRenderWatcher;
30 30
31 // View used to render a WebUI supporting Widget. This widget is used for the 31 // View used to render a WebUI supporting Widget. This widget is used for the
32 // WebUI based start up and lock screens. It contains a StatusAreaView and 32 // WebUI based start up and lock screens. It contains a StatusAreaView and
33 // DOMView. 33 // DOMView.
34 class WebUILoginView : public views::WidgetDelegateView, 34 class WebUILoginView : public views::WidgetDelegateView,
35 public StatusAreaHost, 35 public StatusAreaButton::Delegate,
36 public TabContentsDelegate, 36 public TabContentsDelegate,
37 public chromeos::LoginHtmlDialog::Delegate, 37 public LoginHtmlDialog::Delegate,
38 public TabFirstRenderWatcher::Delegate { 38 public TabFirstRenderWatcher::Delegate {
39 public: 39 public:
40 static const int kStatusAreaCornerPadding; 40 static const int kStatusAreaCornerPadding;
41 41
42 WebUILoginView(); 42 WebUILoginView();
43 virtual ~WebUILoginView(); 43 virtual ~WebUILoginView();
44 44
45 // Initializes the webui login view. 45 // Initializes the webui login view.
46 virtual void Init(views::Widget* login_window); 46 virtual void Init(views::Widget* login_window);
47 47
48 // Overridden from views::Views: 48 // Overridden from views::Views:
49 virtual bool AcceleratorPressed( 49 virtual bool AcceleratorPressed(
50 const views::Accelerator& accelerator) OVERRIDE; 50 const views::Accelerator& accelerator) OVERRIDE;
51 virtual std::string GetClassName() const OVERRIDE; 51 virtual std::string GetClassName() const OVERRIDE;
52 52
53 // Overridden from StatusAreaHost:
54 virtual gfx::NativeWindow GetNativeWindow() const;
55
56 // Called when WebUI window is created. 53 // Called when WebUI window is created.
57 virtual void OnWindowCreated(); 54 virtual void OnWindowCreated();
58 55
56 // Gets the native window from the view widget.
57 gfx::NativeWindow GetNativeWindow() const;
58
59 // Invokes SetWindowType for the window. This is invoked during startup and 59 // Invokes SetWindowType for the window. This is invoked during startup and
60 // after we've painted. 60 // after we've painted.
61 void UpdateWindowType(); 61 void UpdateWindowType();
62 62
63 // Loads given page. Should be called after Init() has been called. 63 // Loads given page. Should be called after Init() has been called.
64 void LoadURL(const GURL& url); 64 void LoadURL(const GURL& url);
65 65
66 // Returns current WebUI. 66 // Returns current WebUI.
67 WebUI* GetWebUI(); 67 WebUI* GetWebUI();
68 68
69 // Toggles whether status area is enabled. 69 // Toggles whether status area is enabled.
70 void SetStatusAreaEnabled(bool enable); 70 void SetStatusAreaEnabled(bool enable);
71 71
72 // Toggles status area visibility. 72 // Toggles status area visibility.
73 void SetStatusAreaVisible(bool visible); 73 void SetStatusAreaVisible(bool visible);
74 74
75 protected: 75 protected:
76 // Overridden from views::View: 76 // Overridden from views::View:
77 virtual void Layout() OVERRIDE; 77 virtual void Layout() OVERRIDE;
78 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; 78 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
79 79
80 // Overridden from StatusAreaHost: 80 // Overridden from StatusAreaButton::Delegate:
81 virtual Profile* GetProfile() const OVERRIDE; 81 virtual bool ShouldExecuteCommand(
82 virtual void ExecuteBrowserCommand(int id) const OVERRIDE; 82 const views::View* button_view, int command_id) const OVERRIDE;
83 virtual bool ShouldOpenButtonOptions( 83 virtual void ExecuteCommand(
84 const views::View* button_view) const OVERRIDE; 84 const views::View* button_view, int command_id) OVERRIDE;
85 virtual void OpenButtonOptions(const views::View* button_view) OVERRIDE; 85 virtual int GetFontStyle(const gfx::Font& font) const OVERRIDE;
86 virtual ScreenMode GetScreenMode() const OVERRIDE; 86 virtual StatusAreaButton::TextStyle GetTextStyle() const OVERRIDE;
87 virtual TextStyle GetTextStyle() const OVERRIDE;
88 virtual void ButtonVisibilityChanged(views::View* button_view) OVERRIDE; 87 virtual void ButtonVisibilityChanged(views::View* button_view) OVERRIDE;
89 88
90 // Overridden from LoginHtmlDialog::Delegate: 89 // Overridden from LoginHtmlDialog::Delegate:
91 virtual void OnDialogClosed() OVERRIDE; 90 virtual void OnDialogClosed() OVERRIDE;
92 virtual void OnLocaleChanged() OVERRIDE; 91 virtual void OnLocaleChanged() OVERRIDE;
93 92
94 // TabFirstRenderWatcher::Delegate implementation. 93 // TabFirstRenderWatcher::Delegate implementation.
95 virtual void OnRenderHostCreated(RenderViewHost* host) OVERRIDE; 94 virtual void OnRenderHostCreated(RenderViewHost* host) OVERRIDE;
96 virtual void OnTabMainFrameLoaded() OVERRIDE; 95 virtual void OnTabMainFrameLoaded() OVERRIDE;
97 virtual void OnTabMainFrameFirstRender() OVERRIDE; 96 virtual void OnTabMainFrameFirstRender() OVERRIDE;
98 97
99 // Creates and adds the status area (separate window). 98 // Creates and adds the status area (separate window).
100 virtual void InitStatusArea(); 99 virtual void InitStatusArea();
101 100
102 StatusAreaView* status_area_; 101 StatusAreaViewChromeos* status_area_;
103 102
104 // DOMView for rendering a webpage as a webui login. 103 // DOMView for rendering a webpage as a webui login.
105 DOMView* webui_login_; 104 DOMView* webui_login_;
106 105
107 private: 106 private:
108 // Map type for the accelerator-to-identifier map. 107 // Map type for the accelerator-to-identifier map.
109 typedef std::map<views::Accelerator, std::string> AccelMap; 108 typedef std::map<views::Accelerator, std::string> AccelMap;
110 109
111 // Overridden from TabContentsDelegate. 110 // Overridden from TabContentsDelegate.
112 virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE; 111 virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 143
145 // Caches StatusArea visibility setting before it has been initialized. 144 // Caches StatusArea visibility setting before it has been initialized.
146 bool status_area_visibility_on_init_; 145 bool status_area_visibility_on_init_;
147 146
148 DISALLOW_COPY_AND_ASSIGN(WebUILoginView); 147 DISALLOW_COPY_AND_ASSIGN(WebUILoginView);
149 }; 148 };
150 149
151 } // namespace chromeos 150 } // namespace chromeos
152 151
153 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WEBUI_LOGIN_VIEW_H_ 152 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WEBUI_LOGIN_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698