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

Side by Side Diff: chrome/browser/geolocation/geolocation_permission_context_extensions.cc

Issue 1200503002: [Extensions] Kill off ExtensionMsg_AddMessageToConsole (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 "chrome/browser/geolocation/geolocation_permission_context_extensions.h " 5 #include "chrome/browser/geolocation/geolocation_permission_context_extensions.h "
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 8
9 #if defined(ENABLE_EXTENSIONS) 9 #if defined(ENABLE_EXTENSIONS)
10 #include "chrome/browser/permissions/permission_request_id.h" 10 #include "chrome/browser/permissions/permission_request_id.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 *permission_set = false; 62 *permission_set = false;
63 *new_permission = false; 63 *new_permission = false;
64 return true; 64 return true;
65 } 65 }
66 66
67 ExtensionRegistry* extension_registry = ExtensionRegistry::Get(profile_); 67 ExtensionRegistry* extension_registry = ExtensionRegistry::Get(profile_);
68 if (extension_registry) { 68 if (extension_registry) {
69 const extensions::Extension* extension = 69 const extensions::Extension* extension =
70 extension_registry->enabled_extensions().GetExtensionOrAppByURL( 70 extension_registry->enabled_extensions().GetExtensionOrAppByURL(
71 requesting_frame_origin); 71 requesting_frame_origin);
72 if (IsExtensionWithPermissionOrSuggestInConsole( 72 if (IsExtensionWithPermissionOrSuggestInConsole(APIPermission::kGeolocation,
73 APIPermission::kGeolocation, extension, 73 extension, web_contents)) {
74 web_contents->GetRenderViewHost())) {
75 // Make sure the extension is in the calling process. 74 // Make sure the extension is in the calling process.
76 if (extensions::ProcessMap::Get(profile_)->Contains( 75 if (extensions::ProcessMap::Get(profile_)->Contains(
77 extension->id(), request_id.render_process_id())) { 76 extension->id(), request_id.render_process_id())) {
78 *permission_set = true; 77 *permission_set = true;
79 *new_permission = true; 78 *new_permission = true;
80 return true; 79 return true;
81 } 80 }
82 } 81 }
83 } 82 }
84 83
(...skipping 22 matching lines...) Expand all
107 web_contents ? 106 web_contents ?
108 extensions::WebViewPermissionHelper::FromWebContents(web_contents) 107 extensions::WebViewPermissionHelper::FromWebContents(web_contents)
109 : NULL; 108 : NULL;
110 if (web_view_permission_helper) { 109 if (web_view_permission_helper) {
111 web_view_permission_helper->CancelGeolocationPermissionRequest(bridge_id); 110 web_view_permission_helper->CancelGeolocationPermissionRequest(bridge_id);
112 return true; 111 return true;
113 } 112 }
114 #endif // defined(ENABLE_EXTENSIONS) 113 #endif // defined(ENABLE_EXTENSIONS)
115 return false; 114 return false;
116 } 115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698