| 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 "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 bool enabled_per_settings) { | 314 bool enabled_per_settings) { |
| 315 return content_settings_->AllowScript(frame, enabled_per_settings); | 315 return content_settings_->AllowScript(frame, enabled_per_settings); |
| 316 } | 316 } |
| 317 | 317 |
| 318 bool ChromeRenderViewObserver::allowScriptExtension( | 318 bool ChromeRenderViewObserver::allowScriptExtension( |
| 319 WebFrame* frame, const WebString& extension_name, int extension_group) { | 319 WebFrame* frame, const WebString& extension_name, int extension_group) { |
| 320 return extension_dispatcher_->AllowScriptExtension( | 320 return extension_dispatcher_->AllowScriptExtension( |
| 321 frame, extension_name.utf8(), extension_group); | 321 frame, extension_name.utf8(), extension_group); |
| 322 } | 322 } |
| 323 | 323 |
| 324 bool ChromeRenderViewObserver::allowStorage(WebFrame* frame, bool local) { |
| 325 return content_settings_->AllowStorage(frame, local); |
| 326 } |
| 327 |
| 324 bool ChromeRenderViewObserver::allowReadFromClipboard(WebFrame* frame, | 328 bool ChromeRenderViewObserver::allowReadFromClipboard(WebFrame* frame, |
| 325 bool default_value) { | 329 bool default_value) { |
| 326 // TODO(dcheng): implement me | 330 // TODO(dcheng): implement me |
| 327 return default_value; | 331 return default_value; |
| 328 } | 332 } |
| 329 | 333 |
| 330 bool ChromeRenderViewObserver::allowWriteToClipboard(WebFrame* frame, | 334 bool ChromeRenderViewObserver::allowWriteToClipboard(WebFrame* frame, |
| 331 bool default_value) { | 335 bool default_value) { |
| 332 // TODO(dcheng): implement me | 336 // TODO(dcheng): implement me |
| 333 return default_value; | 337 return default_value; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) && !data.empty()) { | 681 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) && !data.empty()) { |
| 678 // Decode the favicon using WebKit's image decoder. | 682 // Decode the favicon using WebKit's image decoder. |
| 679 webkit_glue::ImageDecoder decoder(gfx::Size(kFaviconSize, kFaviconSize)); | 683 webkit_glue::ImageDecoder decoder(gfx::Size(kFaviconSize, kFaviconSize)); |
| 680 const unsigned char* src_data = | 684 const unsigned char* src_data = |
| 681 reinterpret_cast<const unsigned char*>(&data[0]); | 685 reinterpret_cast<const unsigned char*>(&data[0]); |
| 682 | 686 |
| 683 return decoder.Decode(src_data, data.size()); | 687 return decoder.Decode(src_data, data.size()); |
| 684 } | 688 } |
| 685 return SkBitmap(); | 689 return SkBitmap(); |
| 686 } | 690 } |
| OLD | NEW |