OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 } | 423 } |
424 | 424 |
425 bool ChromeRenderViewObserver::allowStorage(WebFrame* frame, bool local) { | 425 bool ChromeRenderViewObserver::allowStorage(WebFrame* frame, bool local) { |
426 return content_settings_->AllowStorage(frame, local); | 426 return content_settings_->AllowStorage(frame, local); |
427 } | 427 } |
428 | 428 |
429 bool ChromeRenderViewObserver::allowReadFromClipboard(WebFrame* frame, | 429 bool ChromeRenderViewObserver::allowReadFromClipboard(WebFrame* frame, |
430 bool default_value) { | 430 bool default_value) { |
431 bool allowed = false; | 431 bool allowed = false; |
432 Send(new ChromeViewHostMsg_CanTriggerClipboardRead( | 432 Send(new ChromeViewHostMsg_CanTriggerClipboardRead( |
433 routing_id(), frame->document().url(), &allowed)); | 433 routing_id(), frame->document().securityOrigin().toString().utf8(), |
| 434 &allowed)); |
434 return allowed; | 435 return allowed; |
435 } | 436 } |
436 | 437 |
437 bool ChromeRenderViewObserver::allowWriteToClipboard(WebFrame* frame, | 438 bool ChromeRenderViewObserver::allowWriteToClipboard(WebFrame* frame, |
438 bool default_value) { | 439 bool default_value) { |
439 bool allowed = false; | 440 bool allowed = false; |
440 Send(new ChromeViewHostMsg_CanTriggerClipboardWrite( | 441 Send(new ChromeViewHostMsg_CanTriggerClipboardWrite( |
441 routing_id(), frame->document().url(), &allowed)); | 442 routing_id(), frame->document().securityOrigin().toString().utf8(), |
| 443 &allowed)); |
442 return allowed; | 444 return allowed; |
443 } | 445 } |
444 | 446 |
445 bool ChromeRenderViewObserver::allowDisplayingInsecureContent( | 447 bool ChromeRenderViewObserver::allowDisplayingInsecureContent( |
446 WebKit::WebFrame* frame, | 448 WebKit::WebFrame* frame, |
447 bool allowed_per_settings, | 449 bool allowed_per_settings, |
448 const WebKit::WebSecurityOrigin& origin, | 450 const WebKit::WebSecurityOrigin& origin, |
449 const WebKit::WebURL& url) { | 451 const WebKit::WebURL& url) { |
450 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 452 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, |
451 INSECURE_CONTENT_DISPLAY, | 453 INSECURE_CONTENT_DISPLAY, |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 // Decode the favicon using WebKit's image decoder. | 1071 // Decode the favicon using WebKit's image decoder. |
1070 webkit_glue::ImageDecoder decoder( | 1072 webkit_glue::ImageDecoder decoder( |
1071 gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize)); | 1073 gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize)); |
1072 const unsigned char* src_data = | 1074 const unsigned char* src_data = |
1073 reinterpret_cast<const unsigned char*>(&data[0]); | 1075 reinterpret_cast<const unsigned char*>(&data[0]); |
1074 | 1076 |
1075 return decoder.Decode(src_data, data.size()); | 1077 return decoder.Decode(src_data, data.size()); |
1076 } | 1078 } |
1077 return SkBitmap(); | 1079 return SkBitmap(); |
1078 } | 1080 } |
OLD | NEW |