| 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 frame, extension_name.utf8(), extension_group); | 422 frame, extension_name.utf8(), extension_group); |
| 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 // TODO(dcheng): Should we consider a toURL() method on WebSecurityOrigin? |
| 432 Send(new ChromeViewHostMsg_CanTriggerClipboardRead( | 433 Send(new ChromeViewHostMsg_CanTriggerClipboardRead( |
| 433 routing_id(), frame->document().url(), &allowed)); | 434 routing_id(), GURL(frame->document().securityOrigin().toString().utf8()), |
| 435 &allowed)); |
| 434 return allowed; | 436 return allowed; |
| 435 } | 437 } |
| 436 | 438 |
| 437 bool ChromeRenderViewObserver::allowWriteToClipboard(WebFrame* frame, | 439 bool ChromeRenderViewObserver::allowWriteToClipboard(WebFrame* frame, |
| 438 bool default_value) { | 440 bool default_value) { |
| 439 bool allowed = false; | 441 bool allowed = false; |
| 440 Send(new ChromeViewHostMsg_CanTriggerClipboardWrite( | 442 Send(new ChromeViewHostMsg_CanTriggerClipboardWrite( |
| 441 routing_id(), frame->document().url(), &allowed)); | 443 routing_id(), GURL(frame->document().securityOrigin().toString().utf8()), |
| 444 &allowed)); |
| 442 return allowed; | 445 return allowed; |
| 443 } | 446 } |
| 444 | 447 |
| 445 static void SendInsecureContentSignal(int signal) { | 448 static void SendInsecureContentSignal(int signal) { |
| 446 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", signal, | 449 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", signal, |
| 447 INSECURE_CONTENT_NUM_EVENTS); | 450 INSECURE_CONTENT_NUM_EVENTS); |
| 448 } | 451 } |
| 449 | 452 |
| 450 bool ChromeRenderViewObserver::allowDisplayingInsecureContent( | 453 bool ChromeRenderViewObserver::allowDisplayingInsecureContent( |
| 451 WebKit::WebFrame* frame, | 454 WebKit::WebFrame* frame, |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 // Decode the favicon using WebKit's image decoder. | 1021 // Decode the favicon using WebKit's image decoder. |
| 1019 webkit_glue::ImageDecoder decoder( | 1022 webkit_glue::ImageDecoder decoder( |
| 1020 gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize)); | 1023 gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize)); |
| 1021 const unsigned char* src_data = | 1024 const unsigned char* src_data = |
| 1022 reinterpret_cast<const unsigned char*>(&data[0]); | 1025 reinterpret_cast<const unsigned char*>(&data[0]); |
| 1023 | 1026 |
| 1024 return decoder.Decode(src_data, data.size()); | 1027 return decoder.Decode(src_data, data.size()); |
| 1025 } | 1028 } |
| 1026 return SkBitmap(); | 1029 return SkBitmap(); |
| 1027 } | 1030 } |
| OLD | NEW |