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

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

Issue 378783002: Initial implementation of the <extensionoptions> GuestView tag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 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
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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 WebLocalFrame* frame, 516 WebLocalFrame* frame,
517 const WebPluginParams& params, 517 const WebPluginParams& params,
518 WebPlugin** plugin) { 518 WebPlugin** plugin) {
519 std::string orig_mime_type = params.mimeType.utf8(); 519 std::string orig_mime_type = params.mimeType.utf8();
520 if (orig_mime_type == content::kBrowserPluginMimeType) { 520 if (orig_mime_type == content::kBrowserPluginMimeType) {
521 WebDocument document = frame->document(); 521 WebDocument document = frame->document();
522 const Extension* extension = 522 const Extension* extension =
523 GetExtensionByOrigin(document.securityOrigin()); 523 GetExtensionByOrigin(document.securityOrigin());
524 if (extension) { 524 if (extension) {
525 const extensions::APIPermission::ID perms[] = { 525 const extensions::APIPermission::ID perms[] = {
526 extensions::APIPermission::kAppView, 526 extensions::APIPermission::kAppView,
527 extensions::APIPermission::kWebView, 527 extensions::APIPermission::kEmbeddedExtensionOptions,
528 extensions::APIPermission::kWebView,
528 }; 529 };
529 for (size_t i = 0; i < arraysize(perms); ++i) { 530 for (size_t i = 0; i < arraysize(perms); ++i) {
530 if (extension->permissions_data()->HasAPIPermission(perms[i])) 531 if (extension->permissions_data()->HasAPIPermission(perms[i]))
531 return false; 532 return false;
532 } 533 }
533 } 534 }
534 } 535 }
535 536
536 ChromeViewHostMsg_GetPluginInfo_Output output; 537 ChromeViewHostMsg_GetPluginInfo_Output output;
537 #if defined(ENABLE_PLUGINS) 538 #if defined(ENABLE_PLUGINS)
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 1499
1499 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) 1500 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_))
1500 return true; 1501 return true;
1501 1502
1502 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); 1503 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
1503 return channel <= chrome::VersionInfo::CHANNEL_DEV; 1504 return channel <= chrome::VersionInfo::CHANNEL_DEV;
1504 #else 1505 #else
1505 return false; 1506 return false;
1506 #endif 1507 #endif
1507 } 1508 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698