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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 11362183: [Android WebView] AwContentsClient.shouldCreateWindow callback part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style nits. Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 this, new_contents, params.disposition, initial_pos, 1324 this, new_contents, params.disposition, initial_pos,
1325 params.user_gesture, &was_blocked); 1325 params.user_gesture, &was_blocked);
1326 } 1326 }
1327 if (!was_blocked) { 1327 if (!was_blocked) {
1328 OpenURLParams open_params(params.target_url, 1328 OpenURLParams open_params(params.target_url,
1329 Referrer(), 1329 Referrer(),
1330 CURRENT_TAB, 1330 CURRENT_TAB,
1331 PAGE_TRANSITION_LINK, 1331 PAGE_TRANSITION_LINK,
1332 true /* is_renderer_initiated */); 1332 true /* is_renderer_initiated */);
1333 new_contents->OpenURL(open_params); 1333 new_contents->OpenURL(open_params);
1334 } else {
1335 delete new_contents;
1334 } 1336 }
1335 } 1337 }
1336 } 1338 }
1337 1339
1338 void WebContentsImpl::CreateNewWidget(int route_id, 1340 void WebContentsImpl::CreateNewWidget(int route_id,
1339 WebKit::WebPopupType popup_type) { 1341 WebKit::WebPopupType popup_type) {
1340 CreateNewWidget(route_id, false, popup_type); 1342 CreateNewWidget(route_id, false, popup_type);
1341 } 1343 }
1342 1344
1343 void WebContentsImpl::CreateNewFullscreenWidget(int route_id) { 1345 void WebContentsImpl::CreateNewFullscreenWidget(int route_id) {
(...skipping 25 matching lines...) Expand all
1369 } 1371 }
1370 1372
1371 void WebContentsImpl::ShowCreatedWindow(int route_id, 1373 void WebContentsImpl::ShowCreatedWindow(int route_id,
1372 WindowOpenDisposition disposition, 1374 WindowOpenDisposition disposition,
1373 const gfx::Rect& initial_pos, 1375 const gfx::Rect& initial_pos,
1374 bool user_gesture) { 1376 bool user_gesture) {
1375 WebContentsImpl* contents = GetCreatedWindow(route_id); 1377 WebContentsImpl* contents = GetCreatedWindow(route_id);
1376 if (contents) { 1378 if (contents) {
1377 WebContentsDelegate* delegate = GetDelegate(); 1379 WebContentsDelegate* delegate = GetDelegate();
1378 if (delegate) { 1380 if (delegate) {
1381 bool was_blocked = false;
1379 delegate->AddNewContents( 1382 delegate->AddNewContents(
1380 this, contents, disposition, initial_pos, user_gesture, NULL); 1383 this, contents, disposition, initial_pos, user_gesture, &was_blocked);
1384 if (was_blocked) {
1385 delete contents;
1386 }
1381 } 1387 }
1382 } 1388 }
1383 } 1389 }
1384 1390
1385 void WebContentsImpl::ShowCreatedWidget(int route_id, 1391 void WebContentsImpl::ShowCreatedWidget(int route_id,
1386 const gfx::Rect& initial_pos) { 1392 const gfx::Rect& initial_pos) {
1387 ShowCreatedWidget(route_id, false, initial_pos); 1393 ShowCreatedWidget(route_id, false, initial_pos);
1388 } 1394 }
1389 1395
1390 void WebContentsImpl::ShowCreatedFullscreenWidget(int route_id) { 1396 void WebContentsImpl::ShowCreatedFullscreenWidget(int route_id) {
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after
3321 3327
3322 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { 3328 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() {
3323 return browser_plugin_guest_.get(); 3329 return browser_plugin_guest_.get();
3324 } 3330 }
3325 3331
3326 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { 3332 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() {
3327 return browser_plugin_embedder_.get(); 3333 return browser_plugin_embedder_.get();
3328 } 3334 }
3329 3335
3330 } // namespace content 3336 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698