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 EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 6 #define EXTENSIONS_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" |
11 #include "components/guest_view/browser/guest_view.h" | 11 #include "components/guest_view/browser/guest_view.h" |
12 #include "content/public/browser/javascript_dialog_manager.h" | 12 #include "content/public/browser/javascript_dialog_manager.h" |
13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 #include "extensions/browser/guest_view/web_view/javascript_dialog_helper.h" | 15 #include "extensions/browser/guest_view/web_view/javascript_dialog_helper.h" |
16 #include "extensions/browser/guest_view/web_view/web_view_find_helper.h" | 16 #include "extensions/browser/guest_view/web_view/web_view_find_helper.h" |
17 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" | 17 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" |
18 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" | 18 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" |
19 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" | 19 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" |
20 #include "extensions/browser/script_executor.h" | 20 #include "extensions/browser/script_executor.h" |
21 | 21 |
22 namespace blink { | 22 namespace blink { |
23 struct WebFindOptions; | 23 struct WebFindOptions; |
24 } // nanespace blink | 24 } // nanespace blink |
25 | 25 |
| 26 namespace content { |
| 27 struct GlobalRequestID; |
| 28 } // namespace content |
| 29 |
26 namespace extensions { | 30 namespace extensions { |
27 | 31 |
28 class WebViewInternalFindFunction; | 32 class WebViewInternalFindFunction; |
29 | 33 |
30 // A WebViewGuest provides the browser-side implementation of the <webview> API | 34 // A WebViewGuest provides the browser-side implementation of the <webview> API |
31 // and manages the dispatch of <webview> extension events. WebViewGuest is | 35 // and manages the dispatch of <webview> extension events. WebViewGuest is |
32 // created on attachment. That is, when a guest WebContents is associated with | 36 // created on attachment. That is, when a guest WebContents is associated with |
33 // a particular embedder WebContents. This happens on either initial navigation | 37 // a particular embedder WebContents. This happens on either initial navigation |
34 // or through the use of the New Window API, when a new window is attached to | 38 // or through the use of the New Window API, when a new window is attached to |
35 // a particular <webview>. | 39 // a particular <webview>. |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 void LoadRedirect(const GURL& old_url, | 314 void LoadRedirect(const GURL& old_url, |
311 const GURL& new_url, | 315 const GURL& new_url, |
312 bool is_top_level); | 316 bool is_top_level); |
313 | 317 |
314 void PushWebViewStateToIOThread(); | 318 void PushWebViewStateToIOThread(); |
315 static void RemoveWebViewStateFromIOThread( | 319 static void RemoveWebViewStateFromIOThread( |
316 content::WebContents* web_contents); | 320 content::WebContents* web_contents); |
317 | 321 |
318 // Loads the |url| provided. |force_navigation| indicates whether to reload | 322 // Loads the |url| provided. |force_navigation| indicates whether to reload |
319 // the content if the provided |url| matches the current page of the guest. | 323 // the content if the provided |url| matches the current page of the guest. |
320 void LoadURLWithParams(const GURL& url, | 324 void LoadURLWithParams( |
321 const content::Referrer& referrer, | 325 const GURL& url, |
322 ui::PageTransition transition_type, | 326 const content::Referrer& referrer, |
323 bool force_navigation); | 327 ui::PageTransition transition_type, |
| 328 const content::GlobalRequestID& transferred_global_request_id, |
| 329 bool force_navigation); |
324 | 330 |
325 void RequestNewWindowPermission( | 331 void RequestNewWindowPermission( |
326 WindowOpenDisposition disposition, | 332 WindowOpenDisposition disposition, |
327 const gfx::Rect& initial_bounds, | 333 const gfx::Rect& initial_bounds, |
328 bool user_gesture, | 334 bool user_gesture, |
329 content::WebContents* new_contents); | 335 content::WebContents* new_contents); |
330 | 336 |
331 // Requests resolution of a potentially relative URL. | 337 // Requests resolution of a potentially relative URL. |
332 GURL ResolveURL(const std::string& src); | 338 GURL ResolveURL(const std::string& src); |
333 | 339 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 // This is used to ensure pending tasks will not fire after this object is | 413 // This is used to ensure pending tasks will not fire after this object is |
408 // destroyed. | 414 // destroyed. |
409 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; | 415 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; |
410 | 416 |
411 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 417 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
412 }; | 418 }; |
413 | 419 |
414 } // namespace extensions | 420 } // namespace extensions |
415 | 421 |
416 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 422 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
OLD | NEW |