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

Side by Side Diff: content/browser/frame_host/interstitial_page_impl.cc

Issue 2444383007: Trigger Dangerous indicator for unsafe subresources (Closed)
Patch Set: protip: #include the .h, not the .cc Created 4 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
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 "content/browser/frame_host/interstitial_page_impl.h" 5 #include "content/browser/frame_host/interstitial_page_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 base::WrapUnique(new NavigationEntryImpl); 228 base::WrapUnique(new NavigationEntryImpl);
229 entry->SetURL(url_); 229 entry->SetURL(url_);
230 entry->SetVirtualURL(url_); 230 entry->SetVirtualURL(url_);
231 entry->set_page_type(PAGE_TYPE_INTERSTITIAL); 231 entry->set_page_type(PAGE_TYPE_INTERSTITIAL);
232 232
233 // Give delegates a chance to set some states on the navigation entry. 233 // Give delegates a chance to set some states on the navigation entry.
234 delegate_->OverrideEntry(entry.get()); 234 delegate_->OverrideEntry(entry.get());
235 235
236 controller_->SetTransientEntry(std::move(entry)); 236 controller_->SetTransientEntry(std::move(entry));
237 237
238 static_cast<WebContentsImpl*>(web_contents_)->DidChangeVisibleSSLState(); 238 static_cast<WebContentsImpl*>(web_contents_)
239 ->DidChangeVisibleSecurityState();
239 } 240 }
240 241
241 DCHECK(!render_view_host_); 242 DCHECK(!render_view_host_);
242 render_view_host_ = CreateRenderViewHost(); 243 render_view_host_ = CreateRenderViewHost();
243 CreateWebContentsView(); 244 CreateWebContentsView();
244 245
245 GURL data_url = GURL("data:text/html;charset=utf-8," + 246 GURL data_url = GURL("data:text/html;charset=utf-8," +
246 net::EscapePath(delegate_->GetHTMLContents())); 247 net::EscapePath(delegate_->GetHTMLContents()));
247 frame_tree_.root()->current_frame_host()->NavigateToInterstitialURL(data_url); 248 frame_tree_.root()->current_frame_host()->NavigateToInterstitialURL(data_url);
248 frame_tree_.root()->current_frame_host()->SetAccessibilityMode( 249 frame_tree_.root()->current_frame_host()->SetAccessibilityMode(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 FROM_HERE, base::Bind(&InterstitialPageImpl::Shutdown, 295 FROM_HERE, base::Bind(&InterstitialPageImpl::Shutdown,
295 weak_ptr_factory_.GetWeakPtr())); 296 weak_ptr_factory_.GetWeakPtr()));
296 render_view_host_ = NULL; 297 render_view_host_ = NULL;
297 frame_tree_.root()->ResetForNewProcess(); 298 frame_tree_.root()->ResetForNewProcess();
298 controller_->delegate()->DetachInterstitialPage(); 299 controller_->delegate()->DetachInterstitialPage();
299 // Let's revert to the original title if necessary. 300 // Let's revert to the original title if necessary.
300 NavigationEntry* entry = controller_->GetVisibleEntry(); 301 NavigationEntry* entry = controller_->GetVisibleEntry();
301 if (entry && !new_navigation_ && should_revert_web_contents_title_) 302 if (entry && !new_navigation_ && should_revert_web_contents_title_)
302 web_contents_->UpdateTitleForEntry(entry, original_web_contents_title_); 303 web_contents_->UpdateTitleForEntry(entry, original_web_contents_title_);
303 304
304 static_cast<WebContentsImpl*>(web_contents_)->DidChangeVisibleSSLState(); 305 static_cast<WebContentsImpl*>(web_contents_)->DidChangeVisibleSecurityState();
305 306
306 InterstitialPageMap::iterator iter = 307 InterstitialPageMap::iterator iter =
307 g_web_contents_to_interstitial_page->find(web_contents_); 308 g_web_contents_to_interstitial_page->find(web_contents_);
308 DCHECK(iter != g_web_contents_to_interstitial_page->end()); 309 DCHECK(iter != g_web_contents_to_interstitial_page->end());
309 if (iter != g_web_contents_to_interstitial_page->end()) 310 if (iter != g_web_contents_to_interstitial_page->end())
310 g_web_contents_to_interstitial_page->erase(iter); 311 g_web_contents_to_interstitial_page->erase(iter);
311 312
312 // Clear the WebContents pointer, because it may now be deleted. 313 // Clear the WebContents pointer, because it may now be deleted.
313 // This signifies that we are in the process of shutting down. 314 // This signifies that we are in the process of shutting down.
314 web_contents_ = NULL; 315 web_contents_ = NULL;
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 void InterstitialPageImpl::UpdateDeviceScaleFactor(double device_scale_factor) { 954 void InterstitialPageImpl::UpdateDeviceScaleFactor(double device_scale_factor) {
954 WebContentsImpl* web_contents_impl = 955 WebContentsImpl* web_contents_impl =
955 static_cast<WebContentsImpl*>(web_contents_); 956 static_cast<WebContentsImpl*>(web_contents_);
956 if (!web_contents_impl) 957 if (!web_contents_impl)
957 return; 958 return;
958 959
959 web_contents_impl->UpdateDeviceScaleFactor(device_scale_factor); 960 web_contents_impl->UpdateDeviceScaleFactor(device_scale_factor);
960 } 961 }
961 962
962 } // namespace content 963 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698