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

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

Issue 10413061: Make PageInfoBubble not use BrowserList::GetLastActive and instead obtain a navigator at creation t… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/simple_web_view_dialog.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_SIMPLE_WEB_VIEW_DIALOG_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIMPLE_WEB_VIEW_DIALOG_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIMPLE_WEB_VIEW_DIALOG_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIMPLE_WEB_VIEW_DIALOG_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/command_updater.h" 11 #include "chrome/browser/command_updater.h"
12 #include "chrome/browser/ui/toolbar/toolbar_model_delegate.h" 12 #include "chrome/browser/ui/toolbar/toolbar_model_delegate.h"
13 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 13 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
14 #include "content/public/browser/page_navigator.h"
14 #include "content/public/browser/web_contents_delegate.h" 15 #include "content/public/browser/web_contents_delegate.h"
15 #include "googleurl/src/gurl.h" 16 #include "googleurl/src/gurl.h"
16 #include "ui/views/controls/button/image_button.h" 17 #include "ui/views/controls/button/image_button.h"
17 #include "ui/views/widget/widget_delegate.h" 18 #include "ui/views/widget/widget_delegate.h"
18 19
19 class Profile; 20 class Profile;
20 class ReloadButton; 21 class ReloadButton;
21 class TabContentsWrapper; 22 class TabContentsWrapper;
22 class ToolbarModel; 23 class ToolbarModel;
23 24
24 namespace views { 25 namespace views {
25 class WebView; 26 class WebView;
26 class Widget; 27 class Widget;
27 } 28 }
28 29
29 namespace chromeos { 30 namespace chromeos {
30 31
31 class StubBubbleModelDelegate; 32 class StubBubbleModelDelegate;
32 33
33 // View class which shows the light version of the toolbar and the tab contents. 34 // View class which shows the light version of the toolbar and the tab contents.
34 // Light version of the toolbar includes back, forward buttons and location 35 // Light version of the toolbar includes back, forward buttons and location
35 // bar. Location bar is shown in read only mode, because this view is designed 36 // bar. Location bar is shown in read only mode, because this view is designed
36 // to be used for sign in to captive portal on login screen (when Browser 37 // to be used for sign in to captive portal on login screen (when Browser
37 // isn't running). 38 // isn't running).
38 class SimpleWebViewDialog : public views::ButtonListener, 39 class SimpleWebViewDialog : public views::ButtonListener,
39 public views::WidgetDelegateView, 40 public views::WidgetDelegateView,
40 public LocationBarView::Delegate, 41 public LocationBarView::Delegate,
41 public ToolbarModelDelegate, 42 public ToolbarModelDelegate,
42 public CommandUpdater::CommandUpdaterDelegate, 43 public CommandUpdater::CommandUpdaterDelegate,
44 public content::PageNavigator,
43 public content::WebContentsDelegate { 45 public content::WebContentsDelegate {
44 public: 46 public:
45 explicit SimpleWebViewDialog(Profile* profile); 47 explicit SimpleWebViewDialog(Profile* profile);
46 virtual ~SimpleWebViewDialog(); 48 virtual ~SimpleWebViewDialog();
47 49
48 // Starts loading. 50 // Starts loading.
49 void StartLoad(const GURL& gurl); 51 void StartLoad(const GURL& gurl);
50 52
51 // Inits view. Should be attached to a Widget before call. 53 // Inits view. Should be attached to a Widget before call.
52 void Init(); 54 void Init();
53 55
54 // Overridden from views::WidgetDelegate: 56 // Overridden from views::WidgetDelegate:
55 virtual views::View* GetContentsView() OVERRIDE; 57 virtual views::View* GetContentsView() OVERRIDE;
56 virtual views::View* GetInitiallyFocusedView() OVERRIDE; 58 virtual views::View* GetInitiallyFocusedView() OVERRIDE;
57 59
58 // Implements views::ButtonListener: 60 // Implements views::ButtonListener:
59 virtual void ButtonPressed(views::Button* sender, 61 virtual void ButtonPressed(views::Button* sender,
60 const views::Event& event) OVERRIDE; 62 const views::Event& event) OVERRIDE;
61 63
64 // Implements content::PageNavigator:
65 virtual content::WebContents* OpenURL(
66 const content::OpenURLParams& params) OVERRIDE;
67
62 // Implements content::WebContentsDelegate: 68 // Implements content::WebContentsDelegate:
63 virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE; 69 virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE;
64 70
65 // Implements LocationBarView::Delegate: 71 // Implements LocationBarView::Delegate:
66 virtual void NavigationStateChanged(const content::WebContents* source, 72 virtual void NavigationStateChanged(const content::WebContents* source,
67 unsigned changed_flags) OVERRIDE; 73 unsigned changed_flags) OVERRIDE;
68 virtual TabContentsWrapper* GetTabContentsWrapper() const OVERRIDE; 74 virtual TabContentsWrapper* GetTabContentsWrapper() const OVERRIDE;
69 virtual InstantController* GetInstant() OVERRIDE; 75 virtual InstantController* GetInstant() OVERRIDE;
70 virtual views::Widget* CreateViewsBubble( 76 virtual views::Widget* CreateViewsBubble(
71 views::BubbleDelegateView* bubble_delegate) OVERRIDE; 77 views::BubbleDelegateView* bubble_delegate) OVERRIDE;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 scoped_ptr<views::WebView> web_view_container_; 116 scoped_ptr<views::WebView> web_view_container_;
111 117
112 scoped_ptr<StubBubbleModelDelegate> bubble_model_delegate_; 118 scoped_ptr<StubBubbleModelDelegate> bubble_model_delegate_;
113 119
114 DISALLOW_COPY_AND_ASSIGN(SimpleWebViewDialog); 120 DISALLOW_COPY_AND_ASSIGN(SimpleWebViewDialog);
115 }; 121 };
116 122
117 } // chromeos 123 } // chromeos
118 124
119 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIMPLE_WEB_VIEW_DIALOG_H_ 125 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIMPLE_WEB_VIEW_DIALOG_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/simple_web_view_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698