| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 bool ChromeContentRendererClient::AllowPopup() { | 1118 bool ChromeContentRendererClient::AllowPopup() { |
| 1119 extensions::ScriptContext* current_context = | 1119 extensions::ScriptContext* current_context = |
| 1120 extension_dispatcher_->script_context_set().GetCurrent(); | 1120 extension_dispatcher_->script_context_set().GetCurrent(); |
| 1121 if (!current_context || !current_context->extension()) | 1121 if (!current_context || !current_context->extension()) |
| 1122 return false; | 1122 return false; |
| 1123 // See http://crbug.com/117446 for the subtlety of this check. | 1123 // See http://crbug.com/117446 for the subtlety of this check. |
| 1124 switch (current_context->context_type()) { | 1124 switch (current_context->context_type()) { |
| 1125 case extensions::Feature::UNSPECIFIED_CONTEXT: | 1125 case extensions::Feature::UNSPECIFIED_CONTEXT: |
| 1126 case extensions::Feature::WEB_PAGE_CONTEXT: | 1126 case extensions::Feature::WEB_PAGE_CONTEXT: |
| 1127 case extensions::Feature::UNBLESSED_EXTENSION_CONTEXT: | 1127 case extensions::Feature::UNBLESSED_EXTENSION_CONTEXT: |
| 1128 case extensions::Feature::WEBUI_CONTEXT: |
| 1128 return false; | 1129 return false; |
| 1129 case extensions::Feature::BLESSED_EXTENSION_CONTEXT: | 1130 case extensions::Feature::BLESSED_EXTENSION_CONTEXT: |
| 1130 case extensions::Feature::CONTENT_SCRIPT_CONTEXT: | 1131 case extensions::Feature::CONTENT_SCRIPT_CONTEXT: |
| 1131 return true; | 1132 return true; |
| 1132 case extensions::Feature::BLESSED_WEB_PAGE_CONTEXT: | 1133 case extensions::Feature::BLESSED_WEB_PAGE_CONTEXT: |
| 1133 return !current_context->web_frame()->parent(); | 1134 return !current_context->web_frame()->parent(); |
| 1134 } | 1135 } |
| 1135 NOTREACHED(); | 1136 NOTREACHED(); |
| 1136 return false; | 1137 return false; |
| 1137 } | 1138 } |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1499 | 1500 |
| 1500 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) | 1501 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) |
| 1501 return true; | 1502 return true; |
| 1502 | 1503 |
| 1503 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 1504 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 1504 return channel <= chrome::VersionInfo::CHANNEL_DEV; | 1505 return channel <= chrome::VersionInfo::CHANNEL_DEV; |
| 1505 #else | 1506 #else |
| 1506 return false; | 1507 return false; |
| 1507 #endif | 1508 #endif |
| 1508 } | 1509 } |
| OLD | NEW |