| 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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 frame, extension_name.utf8(), extension_group); | 423 frame, extension_name.utf8(), extension_group); |
| 424 } | 424 } |
| 425 | 425 |
| 426 bool ChromeRenderViewObserver::allowStorage(WebFrame* frame, bool local) { | 426 bool ChromeRenderViewObserver::allowStorage(WebFrame* frame, bool local) { |
| 427 return content_settings_->AllowStorage(frame, local); | 427 return content_settings_->AllowStorage(frame, local); |
| 428 } | 428 } |
| 429 | 429 |
| 430 bool ChromeRenderViewObserver::allowReadFromClipboard(WebFrame* frame, | 430 bool ChromeRenderViewObserver::allowReadFromClipboard(WebFrame* frame, |
| 431 bool default_value) { | 431 bool default_value) { |
| 432 bool allowed = false; | 432 bool allowed = false; |
| 433 // TODO(dcheng): Should we consider a toURL() method on WebSecurityOrigin? |
| 433 Send(new ChromeViewHostMsg_CanTriggerClipboardRead( | 434 Send(new ChromeViewHostMsg_CanTriggerClipboardRead( |
| 434 routing_id(), frame->document().url(), &allowed)); | 435 routing_id(), GURL(frame->document().securityOrigin().toString().utf8()), |
| 436 &allowed)); |
| 435 return allowed; | 437 return allowed; |
| 436 } | 438 } |
| 437 | 439 |
| 438 bool ChromeRenderViewObserver::allowWriteToClipboard(WebFrame* frame, | 440 bool ChromeRenderViewObserver::allowWriteToClipboard(WebFrame* frame, |
| 439 bool default_value) { | 441 bool default_value) { |
| 440 bool allowed = false; | 442 bool allowed = false; |
| 441 Send(new ChromeViewHostMsg_CanTriggerClipboardWrite( | 443 Send(new ChromeViewHostMsg_CanTriggerClipboardWrite( |
| 442 routing_id(), frame->document().url(), &allowed)); | 444 routing_id(), GURL(frame->document().securityOrigin().toString().utf8()), |
| 445 &allowed)); |
| 443 return allowed; | 446 return allowed; |
| 444 } | 447 } |
| 445 | 448 |
| 446 bool ChromeRenderViewObserver::allowDisplayingInsecureContent( | 449 bool ChromeRenderViewObserver::allowDisplayingInsecureContent( |
| 447 WebKit::WebFrame* frame, | 450 WebKit::WebFrame* frame, |
| 448 bool allowed_per_settings, | 451 bool allowed_per_settings, |
| 449 const WebKit::WebSecurityOrigin& origin, | 452 const WebKit::WebSecurityOrigin& origin, |
| 450 const WebKit::WebURL& url) { | 453 const WebKit::WebURL& url) { |
| 451 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 454 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, |
| 452 INSECURE_CONTENT_DISPLAY, | 455 INSECURE_CONTENT_DISPLAY, |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 // Decode the favicon using WebKit's image decoder. | 1089 // Decode the favicon using WebKit's image decoder. |
| 1087 webkit_glue::ImageDecoder decoder( | 1090 webkit_glue::ImageDecoder decoder( |
| 1088 gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize)); | 1091 gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize)); |
| 1089 const unsigned char* src_data = | 1092 const unsigned char* src_data = |
| 1090 reinterpret_cast<const unsigned char*>(&data[0]); | 1093 reinterpret_cast<const unsigned char*>(&data[0]); |
| 1091 | 1094 |
| 1092 return decoder.Decode(src_data, data.size()); | 1095 return decoder.Decode(src_data, data.size()); |
| 1093 } | 1096 } |
| 1094 return SkBitmap(); | 1097 return SkBitmap(); |
| 1095 } | 1098 } |
| OLD | NEW |