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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 707223004: Don't report blocked web contents from already navigated render views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 return effective_url; 508 return effective_url;
509 } 509 }
510 #endif 510 #endif
511 511
512 void SetApplicationLocaleOnIOThread(const std::string& locale) { 512 void SetApplicationLocaleOnIOThread(const std::string& locale) {
513 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 513 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
514 g_io_thread_application_locale.Get() = locale; 514 g_io_thread_application_locale.Get() = locale;
515 } 515 }
516 516
517 void HandleBlockedPopupOnUIThread(const BlockedWindowParams& params) { 517 void HandleBlockedPopupOnUIThread(const BlockedWindowParams& params) {
518 WebContents* tab = tab_util::GetWebContentsByID(params.render_process_id(), 518 // TODO(jochen): This code path should use RenderFrameHosts. See
519 params.opener_id()); 519 // http://crbug.com/431769 for details.
520 if (!tab) 520 RenderViewHost* render_view_host =
521 RenderViewHost::FromID(params.render_process_id(), params.opener_id());
522 if (!render_view_host)
523 return;
524 WebContents* tab = WebContents::FromRenderViewHost(render_view_host);
525 // The tab might already have navigated away.
526 if (!tab || tab->GetRenderViewHost() != render_view_host)
521 return; 527 return;
522 528
523 prerender::PrerenderContents* prerender_contents = 529 prerender::PrerenderContents* prerender_contents =
524 prerender::PrerenderContents::FromWebContents(tab); 530 prerender::PrerenderContents::FromWebContents(tab);
525 if (prerender_contents) { 531 if (prerender_contents) {
526 prerender_contents->Destroy(prerender::FINAL_STATUS_CREATE_NEW_WINDOW); 532 prerender_contents->Destroy(prerender::FINAL_STATUS_CREATE_NEW_WINDOW);
527 return; 533 return;
528 } 534 }
529 535
530 PopupBlockerTabHelper* popup_helper = 536 PopupBlockerTabHelper* popup_helper =
(...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2677 switches::kDisableWebRtcEncryption, 2683 switches::kDisableWebRtcEncryption,
2678 }; 2684 };
2679 to_command_line->CopySwitchesFrom(from_command_line, 2685 to_command_line->CopySwitchesFrom(from_command_line,
2680 kWebRtcDevSwitchNames, 2686 kWebRtcDevSwitchNames,
2681 arraysize(kWebRtcDevSwitchNames)); 2687 arraysize(kWebRtcDevSwitchNames));
2682 } 2688 }
2683 } 2689 }
2684 #endif // defined(ENABLE_WEBRTC) 2690 #endif // defined(ENABLE_WEBRTC)
2685 2691
2686 } // namespace chrome 2692 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698