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 #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 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 } | 1316 } |
1317 | 1317 |
1318 // This code path is taken if Ctrl+Click, middle click or any of the | 1318 // This code path is taken if Ctrl+Click, middle click or any of the |
1319 // keyboard/mouse combinations are used to open a link in a new tab/window. | 1319 // keyboard/mouse combinations are used to open a link in a new tab/window. |
1320 // This code path is also taken on client-side redirects from about:blank. | 1320 // This code path is also taken on client-side redirects from about:blank. |
1321 CreateNewGuestWebViewWindow(params); | 1321 CreateNewGuestWebViewWindow(params); |
1322 return nullptr; | 1322 return nullptr; |
1323 } | 1323 } |
1324 | 1324 |
1325 void WebViewGuest::WebContentsCreated(WebContents* source_contents, | 1325 void WebViewGuest::WebContentsCreated(WebContents* source_contents, |
| 1326 int opener_render_process_id, |
1326 int opener_render_frame_id, | 1327 int opener_render_frame_id, |
1327 const std::string& frame_name, | 1328 const std::string& frame_name, |
1328 const GURL& target_url, | 1329 const GURL& target_url, |
1329 WebContents* new_contents) { | 1330 WebContents* new_contents) { |
1330 auto* guest = WebViewGuest::FromWebContents(new_contents); | 1331 auto* guest = WebViewGuest::FromWebContents(new_contents); |
1331 CHECK(guest); | 1332 CHECK(guest); |
1332 guest->SetOpener(this); | 1333 guest->SetOpener(this); |
1333 guest->name_ = frame_name; | 1334 guest->name_ = frame_name; |
1334 pending_new_windows_.insert( | 1335 pending_new_windows_.insert( |
1335 std::make_pair(guest, NewWindowInfo(target_url, frame_name))); | 1336 std::make_pair(guest, NewWindowInfo(target_url, frame_name))); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1508 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
1508 DispatchEventToView(base::MakeUnique<GuestViewEvent>( | 1509 DispatchEventToView(base::MakeUnique<GuestViewEvent>( |
1509 webview::kEventExitFullscreen, std::move(args))); | 1510 webview::kEventExitFullscreen, std::move(args))); |
1510 } | 1511 } |
1511 // Since we changed fullscreen state, sending a Resize message ensures that | 1512 // Since we changed fullscreen state, sending a Resize message ensures that |
1512 // renderer/ sees the change. | 1513 // renderer/ sees the change. |
1513 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); | 1514 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); |
1514 } | 1515 } |
1515 | 1516 |
1516 } // namespace extensions | 1517 } // namespace extensions |
OLD | NEW |