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

Side by Side Diff: chrome/browser/ui/blocked_content/popup_blocker_tab_helper.cc

Issue 2515823002: Remove WebContents::GetRoutingID(). (Closed)
Patch Set: add render_view_host.h include in resource_dispatcher_host_unittest.cc Created 4 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/blocked_content/popup_blocker_tab_helper.h" 5 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h"
6 6
7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" 10 #include "chrome/browser/ui/blocked_content/blocked_window_params.h"
11 #include "chrome/browser/ui/browser_navigator.h" 11 #include "chrome/browser/ui/browser_navigator.h"
12 #include "chrome/browser/ui/browser_navigator_params.h" 12 #include "chrome/browser/ui/browser_navigator_params.h"
13 #include "chrome/common/features.h" 13 #include "chrome/common/features.h"
14 #include "chrome/common/render_messages.h" 14 #include "chrome/common/render_messages.h"
15 #include "components/content_settings/core/browser/host_content_settings_map.h" 15 #include "components/content_settings/core/browser/host_content_settings_map.h"
16 #include "content/public/browser/navigation_controller.h" 16 #include "content/public/browser/navigation_controller.h"
17 #include "content/public/browser/navigation_details.h" 17 #include "content/public/browser/navigation_details.h"
18 #include "content/public/browser/navigation_entry.h" 18 #include "content/public/browser/navigation_entry.h"
19 #include "content/public/browser/render_view_host.h"
19 #include "content/public/browser/web_contents.h" 20 #include "content/public/browser/web_contents.h"
20 #include "third_party/WebKit/public/web/WebWindowFeatures.h" 21 #include "third_party/WebKit/public/web/WebWindowFeatures.h"
21 22
22 #if BUILDFLAG(ANDROID_JAVA_UI) 23 #if BUILDFLAG(ANDROID_JAVA_UI)
23 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" 24 #include "chrome/browser/ui/android/tab_model/tab_model_list.h"
24 #endif 25 #endif
25 26
26 using blink::WebWindowFeatures; 27 using blink::WebWindowFeatures;
27 28
28 const size_t kMaximumNumberOfPopups = 25; 29 const size_t kMaximumNumberOfPopups = 25;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return; 119 return;
119 // We set user_gesture to true here, so the new popup gets correctly focused. 120 // We set user_gesture to true here, so the new popup gets correctly focused.
120 popup->params.user_gesture = true; 121 popup->params.user_gesture = true;
121 #if BUILDFLAG(ANDROID_JAVA_UI) 122 #if BUILDFLAG(ANDROID_JAVA_UI)
122 TabModelList::HandlePopupNavigation(&popup->params); 123 TabModelList::HandlePopupNavigation(&popup->params);
123 #else 124 #else
124 chrome::Navigate(&popup->params); 125 chrome::Navigate(&popup->params);
125 #endif 126 #endif
126 if (popup->params.target_contents) { 127 if (popup->params.target_contents) {
127 popup->params.target_contents->Send(new ChromeViewMsg_SetWindowFeatures( 128 popup->params.target_contents->Send(new ChromeViewMsg_SetWindowFeatures(
128 popup->params.target_contents->GetRoutingID(), popup->window_features)); 129 popup->params.target_contents->GetRenderViewHost()->GetRoutingID(),
130 popup->window_features));
129 } 131 }
130 blocked_popups_.Remove(id); 132 blocked_popups_.Remove(id);
131 if (blocked_popups_.IsEmpty()) 133 if (blocked_popups_.IsEmpty())
132 PopupNotificationVisibilityChanged(false); 134 PopupNotificationVisibilityChanged(false);
133 } 135 }
134 136
135 size_t PopupBlockerTabHelper::GetBlockedPopupsCount() const { 137 size_t PopupBlockerTabHelper::GetBlockedPopupsCount() const {
136 return blocked_popups_.size(); 138 return blocked_popups_.size();
137 } 139 }
138 140
139 PopupBlockerTabHelper::PopupIdMap 141 PopupBlockerTabHelper::PopupIdMap
140 PopupBlockerTabHelper::GetBlockedPopupRequests() { 142 PopupBlockerTabHelper::GetBlockedPopupRequests() {
141 PopupIdMap result; 143 PopupIdMap result;
142 for (IDMap<BlockedRequest, IDMapOwnPointer>::const_iterator iter( 144 for (IDMap<BlockedRequest, IDMapOwnPointer>::const_iterator iter(
143 &blocked_popups_); 145 &blocked_popups_);
144 !iter.IsAtEnd(); 146 !iter.IsAtEnd();
145 iter.Advance()) { 147 iter.Advance()) {
146 result[iter.GetCurrentKey()] = iter.GetCurrentValue()->params.url; 148 result[iter.GetCurrentKey()] = iter.GetCurrentValue()->params.url;
147 } 149 }
148 return result; 150 return result;
149 } 151 }
OLDNEW
« no previous file with comments | « chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc ('k') | chrome/browser/ui/search/instant_tab_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698