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

Side by Side Diff: chrome/browser/extensions/chrome_extension_web_contents_observer.cc

Issue 2172043002: chrome/browser/extensions: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 "chrome/browser/extensions/chrome_extension_web_contents_observer.h" 5 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/extensions/error_console/error_console.h" 10 #include "chrome/browser/extensions/error_console/error_console.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void ChromeExtensionWebContentsObserver::RenderViewCreated( 44 void ChromeExtensionWebContentsObserver::RenderViewCreated(
45 content::RenderViewHost* render_view_host) { 45 content::RenderViewHost* render_view_host) {
46 ReloadIfTerminated(render_view_host); 46 ReloadIfTerminated(render_view_host);
47 ExtensionWebContentsObserver::RenderViewCreated(render_view_host); 47 ExtensionWebContentsObserver::RenderViewCreated(render_view_host);
48 48
49 const Extension* extension = GetExtension(render_view_host); 49 const Extension* extension = GetExtension(render_view_host);
50 if (!extension) 50 if (!extension)
51 return; 51 return;
52 52
53 int process_id = render_view_host->GetProcess()->GetID(); 53 int process_id = render_view_host->GetProcess()->GetID();
54 auto policy = content::ChildProcessSecurityPolicy::GetInstance(); 54 auto* policy = content::ChildProcessSecurityPolicy::GetInstance();
55 55
56 // Components of chrome that are implemented as extensions or platform apps 56 // Components of chrome that are implemented as extensions or platform apps
57 // are allowed to use chrome://resources/ and chrome://theme/ URLs. 57 // are allowed to use chrome://resources/ and chrome://theme/ URLs.
58 if ((extension->is_extension() || extension->is_platform_app()) && 58 if ((extension->is_extension() || extension->is_platform_app()) &&
59 Manifest::IsComponentLocation(extension->location())) { 59 Manifest::IsComponentLocation(extension->location())) {
60 policy->GrantOrigin(process_id, 60 policy->GrantOrigin(process_id,
61 url::Origin(GURL(content::kChromeUIResourcesURL))); 61 url::Origin(GURL(content::kChromeUIResourcesURL)));
62 policy->GrantOrigin(process_id, 62 policy->GrantOrigin(process_id,
63 url::Origin(GURL(chrome::kChromeUIThemeURL))); 63 url::Origin(GURL(chrome::kChromeUIThemeURL)));
64 } 64 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 if (rappor::RapporService* rappor = g_browser_process->rappor_service()) { 222 if (rappor::RapporService* rappor = g_browser_process->rappor_service()) {
223 const std::string& extension_id = 223 const std::string& extension_id =
224 parent_is_extension ? parent_url.host() : frame_url.host(); 224 parent_is_extension ? parent_url.host() : frame_url.host();
225 rappor->RecordSample("Extensions.AffectedByIsolateExtensions", 225 rappor->RecordSample("Extensions.AffectedByIsolateExtensions",
226 rappor::UMA_RAPPOR_TYPE, extension_id); 226 rappor::UMA_RAPPOR_TYPE, extension_id);
227 } 227 }
228 } 228 }
229 } 229 }
230 230
231 } // namespace extensions 231 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | chrome/browser/extensions/chrome_extensions_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698