OLD | NEW |
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 UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ |
6 #define UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ | 6 #define UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/browser/web_contents_delegate.h" | 10 #include "content/public/browser/web_contents_delegate.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // WebView does not assume ownership of WebContents set via this method, only | 47 // WebView does not assume ownership of WebContents set via this method, only |
48 // those it implicitly creates via GetWebContents() above. | 48 // those it implicitly creates via GetWebContents() above. |
49 void SetWebContents(content::WebContents* web_contents); | 49 void SetWebContents(content::WebContents* web_contents); |
50 | 50 |
51 // If |mode| is true, WebView will register itself with WebContents as a | 51 // If |mode| is true, WebView will register itself with WebContents as a |
52 // WebContentsObserver, monitor for the showing/destruction of fullscreen | 52 // WebContentsObserver, monitor for the showing/destruction of fullscreen |
53 // render widgets, and alter its child view hierarchy to embed the fullscreen | 53 // render widgets, and alter its child view hierarchy to embed the fullscreen |
54 // widget or restore the normal WebContentsView. | 54 // widget or restore the normal WebContentsView. |
55 void SetEmbedFullscreenWidgetMode(bool mode); | 55 void SetEmbedFullscreenWidgetMode(bool mode); |
56 | 56 |
57 content::WebContents* web_contents() const { | |
58 return content::WebContentsObserver::web_contents(); | |
59 } | |
60 | |
61 content::BrowserContext* browser_context() { return browser_context_; } | 57 content::BrowserContext* browser_context() { return browser_context_; } |
62 | 58 |
63 // Loads the initial URL to display in the attached WebContents. Creates the | 59 // Loads the initial URL to display in the attached WebContents. Creates the |
64 // WebContents if none is attached yet. Note that this is intended as a | 60 // WebContents if none is attached yet. Note that this is intended as a |
65 // convenience for loading the initial URL, and so URLs are navigated with | 61 // convenience for loading the initial URL, and so URLs are navigated with |
66 // PAGE_TRANSITION_AUTO_TOPLEVEL, so this is not intended as a general purpose | 62 // PAGE_TRANSITION_AUTO_TOPLEVEL, so this is not intended as a general purpose |
67 // navigation method - use WebContents' API directly. | 63 // navigation method - use WebContents' API directly. |
68 void LoadInitialURL(const GURL& url); | 64 void LoadInitialURL(const GURL& url); |
69 | 65 |
70 // Controls how the attached WebContents is resized. | 66 // Controls how the attached WebContents is resized. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 content::BrowserContext* browser_context_; | 155 content::BrowserContext* browser_context_; |
160 bool allow_accelerators_; | 156 bool allow_accelerators_; |
161 gfx::Size preferred_size_; | 157 gfx::Size preferred_size_; |
162 | 158 |
163 DISALLOW_COPY_AND_ASSIGN(WebView); | 159 DISALLOW_COPY_AND_ASSIGN(WebView); |
164 }; | 160 }; |
165 | 161 |
166 } // namespace views | 162 } // namespace views |
167 | 163 |
168 #endif // UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ | 164 #endif // UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ |
OLD | NEW |