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

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

Issue 12205002: Packaged apps manifest requires 'fullscreen' permission for HTML5 api. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed template params from permission_warnings.html Created 7 years, 10 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
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/browser/extensions/suggest_permission_util.h" 5 #include "chrome/browser/extensions/suggest_permission_util.h"
6 6
7 #include "chrome/browser/extensions/extension_process_manager.h" 7 #include "chrome/browser/extensions/extension_process_manager.h"
8 #include "chrome/browser/extensions/extension_system.h" 8 #include "chrome/browser/extensions/extension_system.h"
9 #include "chrome/common/extensions/extension.h" 9 #include "chrome/common/extensions/extension.h"
10 #include "chrome/common/extensions/extension_messages.h" 10 #include "chrome/common/extensions/extension_messages.h"
(...skipping 12 matching lines...) Expand all
23 namespace extensions { 23 namespace extensions {
24 24
25 void SuggestAPIPermissionInDevToolsConsole(APIPermission::ID permission, 25 void SuggestAPIPermissionInDevToolsConsole(APIPermission::ID permission,
26 const Extension* extension, 26 const Extension* extension,
27 content::RenderViewHost* host) { 27 content::RenderViewHost* host) {
28 if (!extension || !host) 28 if (!extension || !host)
29 return; 29 return;
30 30
31 const APIPermissionInfo* permission_info = 31 const APIPermissionInfo* permission_info =
32 PermissionsInfo::GetInstance()->GetByID(permission); 32 PermissionsInfo::GetInstance()->GetByID(permission);
33 CHECK(permission_info);
33 34
34 // Note, intentionally not internationalizing this string, as it is output 35 // Note, intentionally not internationalizing this string, as it is output
35 // as a log message to developers in the developer tools console. 36 // as a log message to developers in the developer tools console.
36 std::string message = base::StringPrintf( 37 std::string message = base::StringPrintf(
37 "Is the '%s' permission appropriate? See %s.", 38 "Is the '%s' permission appropriate? See %s.",
38 permission_info->name(), 39 permission_info->name(),
39 extension->is_platform_app() ? 40 extension->is_platform_app() ?
40 kPermissionsHelpURLForApps : kPermissionsHelpURLForExtensions); 41 kPermissionsHelpURLForApps : kPermissionsHelpURLForExtensions);
41 42
42 host->Send(new ExtensionMsg_AddMessageToConsole( 43 host->Send(new ExtensionMsg_AddMessageToConsole(
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (extension && extension->HasAPIPermission(permission)) 80 if (extension && extension->HasAPIPermission(permission))
80 return true; 81 return true;
81 82
82 if (extension) 83 if (extension)
83 SuggestAPIPermissionInDevToolsConsole(permission, extension, profile); 84 SuggestAPIPermissionInDevToolsConsole(permission, extension, profile);
84 85
85 return false; 86 return false;
86 } 87 }
87 88
88 } // namespace extensions 89 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_fullscreen_apitest.cc ('k') | chrome/browser/ui/extensions/shell_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698