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_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 virtual void CreateWebContents( | 88 virtual void CreateWebContents( |
89 const std::string& embedder_extension_id, | 89 const std::string& embedder_extension_id, |
90 int embedder_render_process_id, | 90 int embedder_render_process_id, |
91 const base::DictionaryValue& create_params, | 91 const base::DictionaryValue& create_params, |
92 const WebContentsCreatedCallback& callback) OVERRIDE; | 92 const WebContentsCreatedCallback& callback) OVERRIDE; |
93 virtual void DidAttachToEmbedder() OVERRIDE; | 93 virtual void DidAttachToEmbedder() OVERRIDE; |
94 virtual void DidInitialize() OVERRIDE; | 94 virtual void DidInitialize() OVERRIDE; |
95 virtual void DidStopLoading() OVERRIDE; | 95 virtual void DidStopLoading() OVERRIDE; |
96 virtual void EmbedderDestroyed() OVERRIDE; | 96 virtual void EmbedderDestroyed() OVERRIDE; |
97 virtual void GuestDestroyed() OVERRIDE; | 97 virtual void GuestDestroyed() OVERRIDE; |
| 98 virtual void GuestReady() OVERRIDE; |
| 99 virtual void GuestSizeChangedDueToAutoSize( |
| 100 const gfx::Size& old_size, |
| 101 const gfx::Size& new_size) OVERRIDE; |
| 102 virtual bool IsAutoSizeSupported() const OVERRIDE; |
98 virtual bool IsDragAndDropEnabled() const OVERRIDE; | 103 virtual bool IsDragAndDropEnabled() const OVERRIDE; |
99 virtual void WillAttachToEmbedder() OVERRIDE; | 104 virtual void WillAttachToEmbedder() OVERRIDE; |
100 virtual void WillDestroy() OVERRIDE; | 105 virtual void WillDestroy() OVERRIDE; |
101 | 106 |
102 // WebContentsDelegate implementation. | 107 // WebContentsDelegate implementation. |
103 virtual bool AddMessageToConsole(content::WebContents* source, | 108 virtual bool AddMessageToConsole(content::WebContents* source, |
104 int32 level, | 109 int32 level, |
105 const base::string16& message, | 110 const base::string16& message, |
106 int32 line_no, | 111 int32 line_no, |
107 const base::string16& source_id) OVERRIDE; | 112 const base::string16& source_id) OVERRIDE; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 const content::OpenURLParams& params) OVERRIDE; | 154 const content::OpenURLParams& params) OVERRIDE; |
150 virtual void WebContentsCreated(content::WebContents* source_contents, | 155 virtual void WebContentsCreated(content::WebContents* source_contents, |
151 int opener_render_frame_id, | 156 int opener_render_frame_id, |
152 const base::string16& frame_name, | 157 const base::string16& frame_name, |
153 const GURL& target_url, | 158 const GURL& target_url, |
154 content::WebContents* new_contents) OVERRIDE; | 159 content::WebContents* new_contents) OVERRIDE; |
155 | 160 |
156 // BrowserPluginGuestDelegate implementation. | 161 // BrowserPluginGuestDelegate implementation. |
157 virtual content::WebContents* CreateNewGuestWindow( | 162 virtual content::WebContents* CreateNewGuestWindow( |
158 const content::WebContents::CreateParams& create_params) OVERRIDE; | 163 const content::WebContents::CreateParams& create_params) OVERRIDE; |
159 virtual void SizeChanged(const gfx::Size& old_size, const gfx::Size& new_size) | |
160 OVERRIDE; | |
161 virtual void RequestPointerLockPermission( | 164 virtual void RequestPointerLockPermission( |
162 bool user_gesture, | 165 bool user_gesture, |
163 bool last_unlocked_by_target, | 166 bool last_unlocked_by_target, |
164 const base::Callback<void(bool)>& callback) OVERRIDE; | 167 const base::Callback<void(bool)>& callback) OVERRIDE; |
165 // NotificationObserver implementation. | 168 // NotificationObserver implementation. |
166 virtual void Observe(int type, | 169 virtual void Observe(int type, |
167 const content::NotificationSource& source, | 170 const content::NotificationSource& source, |
168 const content::NotificationDetails& details) OVERRIDE; | 171 const content::NotificationDetails& details) OVERRIDE; |
169 | 172 |
170 // Returns the current zoom factor. | 173 // Returns the current zoom factor. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 const GURL& validated_url, | 271 const GURL& validated_url, |
269 bool is_error_page, | 272 bool is_error_page, |
270 bool is_iframe_srcdoc) OVERRIDE; | 273 bool is_iframe_srcdoc) OVERRIDE; |
271 virtual void DocumentLoadedInFrame( | 274 virtual void DocumentLoadedInFrame( |
272 content::RenderFrameHost* render_frame_host) OVERRIDE; | 275 content::RenderFrameHost* render_frame_host) OVERRIDE; |
273 virtual bool OnMessageReceived( | 276 virtual bool OnMessageReceived( |
274 const IPC::Message& message, | 277 const IPC::Message& message, |
275 content::RenderFrameHost* render_frame_host) OVERRIDE; | 278 content::RenderFrameHost* render_frame_host) OVERRIDE; |
276 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 279 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; |
277 virtual void UserAgentOverrideSet(const std::string& user_agent) OVERRIDE; | 280 virtual void UserAgentOverrideSet(const std::string& user_agent) OVERRIDE; |
278 virtual void RenderViewReady() OVERRIDE; | |
279 | 281 |
280 // Informs the embedder of a frame name change. | 282 // Informs the embedder of a frame name change. |
281 void ReportFrameNameChange(const std::string& name); | 283 void ReportFrameNameChange(const std::string& name); |
282 | 284 |
283 // Called after the load handler is called in the guest's main frame. | 285 // Called after the load handler is called in the guest's main frame. |
284 void LoadHandlerCalled(); | 286 void LoadHandlerCalled(); |
285 | 287 |
286 // Called when a redirect notification occurs. | 288 // Called when a redirect notification occurs. |
287 void LoadRedirect(const GURL& old_url, | 289 void LoadRedirect(const GURL& old_url, |
288 const GURL& new_url, | 290 const GURL& new_url, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 void OnUpdateFrameName(bool is_top_level, const std::string& name); | 329 void OnUpdateFrameName(bool is_top_level, const std::string& name); |
328 | 330 |
329 // Creates a new guest window owned by this WebViewGuest. | 331 // Creates a new guest window owned by this WebViewGuest. |
330 void CreateNewGuestWebViewWindow(const content::OpenURLParams& params); | 332 void CreateNewGuestWebViewWindow(const content::OpenURLParams& params); |
331 | 333 |
332 void NewGuestWebViewCallback(const content::OpenURLParams& params, | 334 void NewGuestWebViewCallback(const content::OpenURLParams& params, |
333 content::WebContents* guest_web_contents); | 335 content::WebContents* guest_web_contents); |
334 | 336 |
335 bool HandleKeyboardShortcuts(const content::NativeWebKeyboardEvent& event); | 337 bool HandleKeyboardShortcuts(const content::NativeWebKeyboardEvent& event); |
336 | 338 |
| 339 void SetUpAutoSize(); |
| 340 |
337 ObserverList<extensions::TabHelper::ScriptExecutionObserver> | 341 ObserverList<extensions::TabHelper::ScriptExecutionObserver> |
338 script_observers_; | 342 script_observers_; |
339 scoped_ptr<extensions::ScriptExecutor> script_executor_; | 343 scoped_ptr<extensions::ScriptExecutor> script_executor_; |
340 | 344 |
341 content::NotificationRegistrar notification_registrar_; | 345 content::NotificationRegistrar notification_registrar_; |
342 | 346 |
343 // A counter to generate a unique request id for a context menu request. | 347 // A counter to generate a unique request id for a context menu request. |
344 // We only need the ids to be unique for a given WebViewGuest. | 348 // We only need the ids to be unique for a given WebViewGuest. |
345 int pending_context_menu_request_id_; | 349 int pending_context_menu_request_id_; |
346 | 350 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 changed(false) {} | 394 changed(false) {} |
391 }; | 395 }; |
392 | 396 |
393 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; | 397 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; |
394 PendingWindowMap pending_new_windows_; | 398 PendingWindowMap pending_new_windows_; |
395 | 399 |
396 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 400 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
397 }; | 401 }; |
398 | 402 |
399 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 403 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
OLD | NEW |