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

Side by Side Diff: extensions/browser/extension_web_contents_observer.cc

Issue 273193004: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing files. Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extension_web_contents_observer.h" 5 #include "extensions/browser/extension_web_contents_observer.h"
6 6
7 #include "content/public/browser/child_process_security_policy.h" 7 #include "content/public/browser/child_process_security_policy.h"
8 #include "content/public/browser/render_process_host.h" 8 #include "content/public/browser/render_process_host.h"
9 #include "content/public/browser/render_view_host.h" 9 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/site_instance.h" 10 #include "content/public/browser/site_instance.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( 48 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
49 process->GetID(), content::kChromeUIScheme); 49 process->GetID(), content::kChromeUIScheme);
50 } 50 }
51 51
52 // Some extensions use file:// URLs. 52 // Some extensions use file:// URLs.
53 if (type == Manifest::TYPE_EXTENSION || 53 if (type == Manifest::TYPE_EXTENSION ||
54 type == Manifest::TYPE_LEGACY_PACKAGED_APP) { 54 type == Manifest::TYPE_LEGACY_PACKAGED_APP) {
55 ExtensionPrefs* prefs = ExtensionPrefs::Get(browser_context_); 55 ExtensionPrefs* prefs = ExtensionPrefs::Get(browser_context_);
56 if (prefs->AllowFileAccess(extension->id())) { 56 if (prefs->AllowFileAccess(extension->id())) {
57 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( 57 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
58 process->GetID(), content::kFileScheme); 58 process->GetID(), url::kFileScheme);
59 } 59 }
60 } 60 }
61 61
62 switch (type) { 62 switch (type) {
63 case Manifest::TYPE_EXTENSION: 63 case Manifest::TYPE_EXTENSION:
64 case Manifest::TYPE_USER_SCRIPT: 64 case Manifest::TYPE_USER_SCRIPT:
65 case Manifest::TYPE_HOSTED_APP: 65 case Manifest::TYPE_HOSTED_APP:
66 case Manifest::TYPE_LEGACY_PACKAGED_APP: 66 case Manifest::TYPE_LEGACY_PACKAGED_APP:
67 case Manifest::TYPE_PLATFORM_APP: 67 case Manifest::TYPE_PLATFORM_APP:
68 // Always send a Loaded message before ActivateExtension so that 68 // Always send a Loaded message before ActivateExtension so that
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // site, so we can ignore that wrinkle here. 114 // site, so we can ignore that wrinkle here.
115 const GURL& site = render_view_host->GetSiteInstance()->GetSiteURL(); 115 const GURL& site = render_view_host->GetSiteInstance()->GetSiteURL();
116 116
117 if (!site.SchemeIs(kExtensionScheme)) 117 if (!site.SchemeIs(kExtensionScheme))
118 return std::string(); 118 return std::string();
119 119
120 return site.host(); 120 return site.host();
121 } 121 }
122 122
123 } // namespace extensions 123 } // namespace extensions
OLDNEW
« no previous file with comments | « content/shell/browser/shell_url_request_context_getter.cc ('k') | extensions/common/permissions/permission_message_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698