Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 404883002: Allow extension APIs to be called from WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compile Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/extensions/webui/on_message.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 bool ChromeContentRendererClient::AllowPopup() { 1116 bool ChromeContentRendererClient::AllowPopup() {
1117 extensions::ScriptContext* current_context = 1117 extensions::ScriptContext* current_context =
1118 extension_dispatcher_->script_context_set().GetCurrent(); 1118 extension_dispatcher_->script_context_set().GetCurrent();
1119 if (!current_context || !current_context->extension()) 1119 if (!current_context || !current_context->extension())
1120 return false; 1120 return false;
1121 // See http://crbug.com/117446 for the subtlety of this check. 1121 // See http://crbug.com/117446 for the subtlety of this check.
1122 switch (current_context->context_type()) { 1122 switch (current_context->context_type()) {
1123 case extensions::Feature::UNSPECIFIED_CONTEXT: 1123 case extensions::Feature::UNSPECIFIED_CONTEXT:
1124 case extensions::Feature::WEB_PAGE_CONTEXT: 1124 case extensions::Feature::WEB_PAGE_CONTEXT:
1125 case extensions::Feature::UNBLESSED_EXTENSION_CONTEXT: 1125 case extensions::Feature::UNBLESSED_EXTENSION_CONTEXT:
1126 case extensions::Feature::WEBUI_CONTEXT:
1126 return false; 1127 return false;
1127 case extensions::Feature::BLESSED_EXTENSION_CONTEXT: 1128 case extensions::Feature::BLESSED_EXTENSION_CONTEXT:
1128 case extensions::Feature::CONTENT_SCRIPT_CONTEXT: 1129 case extensions::Feature::CONTENT_SCRIPT_CONTEXT:
1129 return true; 1130 return true;
1130 case extensions::Feature::BLESSED_WEB_PAGE_CONTEXT: 1131 case extensions::Feature::BLESSED_WEB_PAGE_CONTEXT:
1131 return !current_context->web_frame()->parent(); 1132 return !current_context->web_frame()->parent();
1132 } 1133 }
1133 NOTREACHED(); 1134 NOTREACHED();
1134 return false; 1135 return false;
1135 } 1136 }
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 1498
1498 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) 1499 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_))
1499 return true; 1500 return true;
1500 1501
1501 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); 1502 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
1502 return channel <= chrome::VersionInfo::CHANNEL_DEV; 1503 return channel <= chrome::VersionInfo::CHANNEL_DEV;
1503 #else 1504 #else
1504 return false; 1505 return false;
1505 #endif 1506 #endif
1506 } 1507 }
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/extensions/webui/on_message.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698