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

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

Issue 2894973002: Provide WebContents::CreateParams to tab helpers. (Closed)
Patch Set: rebase Created 3 years, 6 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 #include "extensions/browser/guest_view/web_view/web_view_guest.h" 5 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 return web_contents(); 1332 return web_contents();
1333 } 1333 }
1334 1334
1335 // This code path is taken if Ctrl+Click, middle click or any of the 1335 // This code path is taken if Ctrl+Click, middle click or any of the
1336 // keyboard/mouse combinations are used to open a link in a new tab/window. 1336 // keyboard/mouse combinations are used to open a link in a new tab/window.
1337 // This code path is also taken on client-side redirects from about:blank. 1337 // This code path is also taken on client-side redirects from about:blank.
1338 CreateNewGuestWebViewWindow(params); 1338 CreateNewGuestWebViewWindow(params);
1339 return nullptr; 1339 return nullptr;
1340 } 1340 }
1341 1341
1342 void WebViewGuest::WebContentsCreated(WebContents* source_contents, 1342 void WebViewGuest::WebContentsCreated(
1343 int opener_render_process_id, 1343 WebContents* source_contents,
1344 int opener_render_frame_id, 1344 int opener_render_process_id,
1345 const std::string& frame_name, 1345 int opener_render_frame_id,
1346 const GURL& target_url, 1346 const std::string& frame_name,
1347 WebContents* new_contents) { 1347 const GURL& target_url,
1348 WebContents* new_contents,
1349 const base::Optional<content::WebContents::CreateParams>& create_params) {
1348 auto* guest = WebViewGuest::FromWebContents(new_contents); 1350 auto* guest = WebViewGuest::FromWebContents(new_contents);
1349 CHECK(guest); 1351 CHECK(guest);
1350 guest->SetOpener(this); 1352 guest->SetOpener(this);
1351 guest->name_ = frame_name; 1353 guest->name_ = frame_name;
1352 pending_new_windows_.insert( 1354 pending_new_windows_.insert(
1353 std::make_pair(guest, NewWindowInfo(target_url, frame_name))); 1355 std::make_pair(guest, NewWindowInfo(target_url, frame_name)));
1354 } 1356 }
1355 1357
1356 void WebViewGuest::EnterFullscreenModeForTab(WebContents* web_contents, 1358 void WebViewGuest::EnterFullscreenModeForTab(WebContents* web_contents,
1357 const GURL& origin) { 1359 const GURL& origin) {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 auto args = base::MakeUnique<base::DictionaryValue>(); 1532 auto args = base::MakeUnique<base::DictionaryValue>();
1531 DispatchEventToView(base::MakeUnique<GuestViewEvent>( 1533 DispatchEventToView(base::MakeUnique<GuestViewEvent>(
1532 webview::kEventExitFullscreen, std::move(args))); 1534 webview::kEventExitFullscreen, std::move(args)));
1533 } 1535 }
1534 // Since we changed fullscreen state, sending a Resize message ensures that 1536 // Since we changed fullscreen state, sending a Resize message ensures that
1535 // renderer/ sees the change. 1537 // renderer/ sees the change.
1536 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); 1538 web_contents()->GetRenderViewHost()->GetWidget()->WasResized();
1537 } 1539 }
1538 1540
1539 } // namespace extensions 1541 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.h ('k') | headless/lib/browser/headless_web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698