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

Side by Side Diff: chrome/renderer/chrome_render_view_observer.cc

Issue 10577028: Move the mixed scripting infobar to a page action icon / content setting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months 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 "chrome/renderer/chrome_render_view_observer.h" 5 #include "chrome/renderer/chrome_render_view_observer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 TranslateHelper* translate_helper) 222 TranslateHelper* translate_helper)
223 : content::RenderViewObserver(render_view), 223 : content::RenderViewObserver(render_view),
224 chrome_render_process_observer_(chrome_render_process_observer), 224 chrome_render_process_observer_(chrome_render_process_observer),
225 extension_dispatcher_(extension_dispatcher), 225 extension_dispatcher_(extension_dispatcher),
226 content_settings_(content_settings), 226 content_settings_(content_settings),
227 translate_helper_(translate_helper), 227 translate_helper_(translate_helper),
228 phishing_classifier_(NULL), 228 phishing_classifier_(NULL),
229 last_indexed_page_id_(-1), 229 last_indexed_page_id_(-1),
230 allow_displaying_insecure_content_(false), 230 allow_displaying_insecure_content_(false),
231 allow_running_insecure_content_(false), 231 allow_running_insecure_content_(false),
232 warned_about_insecure_content_(false),
233 capture_timer_(false, false) { 232 capture_timer_(false, false) {
234 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 233 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
235 render_view->GetWebView()->setPermissionClient(this); 234 render_view->GetWebView()->setPermissionClient(this);
236 if (!command_line.HasSwitch(switches::kDisableClientSidePhishingDetection)) 235 if (!command_line.HasSwitch(switches::kDisableClientSidePhishingDetection))
237 OnSetClientSidePhishingDetection(true); 236 OnSetClientSidePhishingDetection(true);
238 } 237 }
239 238
240 ChromeRenderViewObserver::~ChromeRenderViewObserver() { 239 ChromeRenderViewObserver::~ChromeRenderViewObserver() {
241 } 240 }
242 241
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 SendInsecureContentSignal(INSECURE_CONTENT_RUN_TARGET_YOUTUBE); 622 SendInsecureContentSignal(INSECURE_CONTENT_RUN_TARGET_YOUTUBE);
624 623
625 if (EndsWith(resource_gurl.path(), kDotJS, false)) 624 if (EndsWith(resource_gurl.path(), kDotJS, false))
626 SendInsecureContentSignal(INSECURE_CONTENT_RUN_JS); 625 SendInsecureContentSignal(INSECURE_CONTENT_RUN_JS);
627 else if (EndsWith(resource_gurl.path(), kDotCSS, false)) 626 else if (EndsWith(resource_gurl.path(), kDotCSS, false))
628 SendInsecureContentSignal(INSECURE_CONTENT_RUN_CSS); 627 SendInsecureContentSignal(INSECURE_CONTENT_RUN_CSS);
629 else if (EndsWith(resource_gurl.path(), kDotSWF, false)) 628 else if (EndsWith(resource_gurl.path(), kDotSWF, false))
630 SendInsecureContentSignal(INSECURE_CONTENT_RUN_SWF); 629 SendInsecureContentSignal(INSECURE_CONTENT_RUN_SWF);
631 630
632 if (!allow_running_insecure_content_ && !allowed_per_settings) { 631 if (!allow_running_insecure_content_ && !allowed_per_settings) {
633 if (!warned_about_insecure_content_ && !IsStrictSecurityHost(origin_host)) { 632 if (!IsStrictSecurityHost(origin_host))
634 warned_about_insecure_content_ = true; 633 content_settings_->DidNotAllowMixedScript();
635 Send(new ChromeViewHostMsg_DidBlockRunningInsecureContent(routing_id()));
636 }
637 return false; 634 return false;
638 } 635 }
639 636
640 return true; 637 return true;
641 } 638 }
642 639
643 void ChromeRenderViewObserver::didNotAllowPlugins(WebFrame* frame) { 640 void ChromeRenderViewObserver::didNotAllowPlugins(WebFrame* frame) {
644 content_settings_->DidNotAllowPlugins(frame); 641 content_settings_->DidNotAllowPlugins();
645 } 642 }
646 643
647 void ChromeRenderViewObserver::didNotAllowScript(WebFrame* frame) { 644 void ChromeRenderViewObserver::didNotAllowScript(WebFrame* frame) {
648 content_settings_->DidNotAllowScript(frame); 645 content_settings_->DidNotAllowScript();
649 } 646 }
650 647
651 void ChromeRenderViewObserver::OnSetIsPrerendering(bool is_prerendering) { 648 void ChromeRenderViewObserver::OnSetIsPrerendering(bool is_prerendering) {
652 if (is_prerendering) { 649 if (is_prerendering) {
653 DCHECK(!prerender::PrerenderHelper::Get(render_view())); 650 DCHECK(!prerender::PrerenderHelper::Get(render_view()));
654 // The PrerenderHelper will destroy itself either after recording histograms 651 // The PrerenderHelper will destroy itself either after recording histograms
655 // or on destruction of the RenderView. 652 // or on destruction of the RenderView.
656 new prerender::PrerenderHelper(render_view()); 653 new prerender::PrerenderHelper(render_view());
657 } 654 }
658 } 655 }
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 reinterpret_cast<const unsigned char*>(&data[0]); 1072 reinterpret_cast<const unsigned char*>(&data[0]);
1076 1073
1077 return decoder.Decode(src_data, data.size()); 1074 return decoder.Decode(src_data, data.size());
1078 } 1075 }
1079 return SkBitmap(); 1076 return SkBitmap();
1080 } 1077 }
1081 1078
1082 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { 1079 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) {
1083 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); 1080 return (strict_security_hosts_.find(host) != strict_security_hosts_.end());
1084 } 1081 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_render_view_observer.h ('k') | chrome/renderer/content_settings_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698