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

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_guest.h

Issue 618823002: GuestView: Move lifetime management out of content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment Created 6 years, 2 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
OLDNEW
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"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 std::string* partition_name, 51 std::string* partition_name,
52 bool* in_memory); 52 bool* in_memory);
53 53
54 // Returns guestview::kInstanceIDNone if |contents| does not correspond to a 54 // Returns guestview::kInstanceIDNone if |contents| does not correspond to a
55 // WebViewGuest. 55 // WebViewGuest.
56 static int GetViewInstanceId(content::WebContents* contents); 56 static int GetViewInstanceId(content::WebContents* contents);
57 57
58 static const char Type[]; 58 static const char Type[];
59 59
60 // Request navigating the guest to the provided |src| URL. 60 // Request navigating the guest to the provided |src| URL.
61 void NavigateGuest(const std::string& src); 61 void NavigateGuest(const std::string& src, bool force_navigation);
62 62
63 // Shows the context menu for the guest. 63 // Shows the context menu for the guest.
64 // |items| acts as a filter. This restricts the current context's default 64 // |items| acts as a filter. This restricts the current context's default
65 // menu items to contain only the items from |items|. 65 // menu items to contain only the items from |items|.
66 // |items| == NULL means no filtering will be applied. 66 // |items| == NULL means no filtering will be applied.
67 void ShowContextMenu( 67 void ShowContextMenu(
68 int request_id, 68 int request_id,
69 const WebViewGuestDelegate::MenuItemVector* items); 69 const WebViewGuestDelegate::MenuItemVector* items);
70 70
71 // Sets the frame name of the guest. 71 // Sets the frame name of the guest.
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 336
337 // True if the user agent is overridden. 337 // True if the user agent is overridden.
338 bool is_overriding_user_agent_; 338 bool is_overriding_user_agent_;
339 339
340 // Stores the window name of the main frame of the guest. 340 // Stores the window name of the main frame of the guest.
341 std::string name_; 341 std::string name_;
342 342
343 // Stores whether the contents of the guest can be transparent. 343 // Stores whether the contents of the guest can be transparent.
344 bool guest_opaque_; 344 bool guest_opaque_;
345 345
346 // Stores the src URL of the WebView.
347 GURL src_;
348
346 // Handles the JavaScript dialog requests. 349 // Handles the JavaScript dialog requests.
347 JavaScriptDialogHelper javascript_dialog_helper_; 350 JavaScriptDialogHelper javascript_dialog_helper_;
348 351
349 // Handels permission requests. 352 // Handles permission requests.
350 scoped_ptr<WebViewPermissionHelper> web_view_permission_helper_; 353 scoped_ptr<WebViewPermissionHelper> web_view_permission_helper_;
351 354
352 scoped_ptr<WebViewGuestDelegate> web_view_guest_delegate_; 355 scoped_ptr<WebViewGuestDelegate> web_view_guest_delegate_;
353 356
354 // Tracks the name, and target URL of the new window. Once the first 357 // Tracks the name, and target URL of the new window. Once the first
355 // navigation commits, we no longer track this information. 358 // navigation commits, we no longer track this information.
356 struct NewWindowInfo { 359 struct NewWindowInfo {
357 GURL url; 360 GURL url;
358 std::string name; 361 std::string name;
359 bool changed; 362 bool changed;
360 NewWindowInfo(const GURL& url, const std::string& name) : 363 NewWindowInfo(const GURL& url, const std::string& name) :
361 url(url), 364 url(url),
362 name(name), 365 name(name),
363 changed(false) {} 366 changed(false) {}
364 }; 367 };
365 368
366 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; 369 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap;
367 PendingWindowMap pending_new_windows_; 370 PendingWindowMap pending_new_windows_;
368 371
369 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); 372 DISALLOW_COPY_AND_ASSIGN(WebViewGuest);
370 }; 373 };
371 374
372 } // namespace extensions 375 } // namespace extensions
373 376
374 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ 377 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_constants.cc ('k') | extensions/browser/guest_view/web_view/web_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698