| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2719 return true; | 2719 return true; |
| 2720 | 2720 |
| 2721 if (IsWhitelistedForContentSettings(frame)) | 2721 if (IsWhitelistedForContentSettings(frame)) |
| 2722 return true; | 2722 return true; |
| 2723 | 2723 |
| 2724 DidBlockContentType(CONTENT_SETTINGS_TYPE_IMAGES, std::string()); | 2724 DidBlockContentType(CONTENT_SETTINGS_TYPE_IMAGES, std::string()); |
| 2725 return false; // Other protocols fall through here. | 2725 return false; // Other protocols fall through here. |
| 2726 } | 2726 } |
| 2727 | 2727 |
| 2728 bool RenderView::allowPlugins(WebFrame* frame, bool enabled_per_settings) { | 2728 bool RenderView::allowPlugins(WebFrame* frame, bool enabled_per_settings) { |
| 2729 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 2729 return WebFrameClient::allowPlugins(frame, enabled_per_settings); |
| 2730 switches::kDisableClickToPlay)) { | |
| 2731 return WebFrameClient::allowPlugins(frame, enabled_per_settings); | |
| 2732 } | |
| 2733 return enabled_per_settings && | |
| 2734 AllowContentType(CONTENT_SETTINGS_TYPE_PLUGINS); | |
| 2735 } | 2730 } |
| 2736 | 2731 |
| 2737 | 2732 |
| 2738 void RenderView::loadURLExternally( | 2733 void RenderView::loadURLExternally( |
| 2739 WebFrame* frame, const WebURLRequest& request, | 2734 WebFrame* frame, const WebURLRequest& request, |
| 2740 WebNavigationPolicy policy) { | 2735 WebNavigationPolicy policy) { |
| 2741 GURL referrer(request.httpHeaderField(WebString::fromUTF8("Referer"))); | 2736 GURL referrer(request.httpHeaderField(WebString::fromUTF8("Referer"))); |
| 2742 if (policy == WebKit::WebNavigationPolicyDownload) { | 2737 if (policy == WebKit::WebNavigationPolicyDownload) { |
| 2743 Send(new ViewHostMsg_DownloadUrl(routing_id_, request.url(), referrer)); | 2738 Send(new ViewHostMsg_DownloadUrl(routing_id_, request.url(), referrer)); |
| 2744 } else { | 2739 } else { |
| (...skipping 2742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5487 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), | 5482 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), |
| 5488 message_id); | 5483 message_id); |
| 5489 } | 5484 } |
| 5490 | 5485 |
| 5491 #if defined(OS_MACOSX) | 5486 #if defined(OS_MACOSX) |
| 5492 void RenderView::OnSelectPopupMenuItem(int selected_index) { | 5487 void RenderView::OnSelectPopupMenuItem(int selected_index) { |
| 5493 external_popup_menu_->DidSelectItem(selected_index); | 5488 external_popup_menu_->DidSelectItem(selected_index); |
| 5494 external_popup_menu_.reset(); | 5489 external_popup_menu_.reset(); |
| 5495 } | 5490 } |
| 5496 #endif | 5491 #endif |
| OLD | NEW |