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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::allowReadFromClipboard(WebFrame* frame, | 324 bool ChromeRenderViewObserver::allowReadFromClipboard(WebFrame* frame, |
325 bool default_value) { | 325 bool default_value) { |
326 // TODO(dcheng): implement me | 326 bool allowed = false; |
327 return default_value; | 327 Send(new ViewHostMsg_CanTriggerClipboardRead( |
| 328 routing_id(), frame->url(), &allowed)); |
| 329 return allowed; |
328 } | 330 } |
329 | 331 |
330 bool ChromeRenderViewObserver::allowWriteToClipboard(WebFrame* frame, | 332 bool ChromeRenderViewObserver::allowWriteToClipboard(WebFrame* frame, |
331 bool default_value) { | 333 bool default_value) { |
332 // TODO(dcheng): implement me | 334 bool allowed = false; |
333 return default_value; | 335 Send(new ViewHostMsg_CanTriggerClipboardWrite( |
| 336 routing_id(), frame->url(), &allowed)); |
| 337 return allowed; |
334 } | 338 } |
335 | 339 |
336 void ChromeRenderViewObserver::didNotAllowPlugins(WebFrame* frame) { | 340 void ChromeRenderViewObserver::didNotAllowPlugins(WebFrame* frame) { |
337 content_settings_->DidNotAllowPlugins(frame); | 341 content_settings_->DidNotAllowPlugins(frame); |
338 } | 342 } |
339 | 343 |
340 void ChromeRenderViewObserver::didNotAllowScript(WebFrame* frame) { | 344 void ChromeRenderViewObserver::didNotAllowScript(WebFrame* frame) { |
341 content_settings_->DidNotAllowScript(frame); | 345 content_settings_->DidNotAllowScript(frame); |
342 } | 346 } |
343 | 347 |
(...skipping 333 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 |