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

Side by Side Diff: chrome/common/extensions/manifest_handlers/extension_action_handler.cc

Issue 1778603003: [Extensions] Update installed bubble for extensions with synthesized actions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Win fix Created 4 years, 9 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
« no previous file with comments | « chrome/common/extensions/api/extension_action/action_info.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/extensions/manifest_handlers/extension_action_handler.h" 5 #include "chrome/common/extensions/manifest_handlers/extension_action_handler.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/extensions/api/extension_action/action_info.h" 10 #include "chrome/common/extensions/api/extension_action/action_info.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return true; // Don't synthesize actions for default extensions. 67 return true; // Don't synthesize actions for default extensions.
68 if (extension->manifest()->HasKey( 68 if (extension->manifest()->HasKey(
69 manifest_keys::kSynthesizeExtensionAction)) { 69 manifest_keys::kSynthesizeExtensionAction)) {
70 *error = base::ASCIIToUTF16(base::StringPrintf( 70 *error = base::ASCIIToUTF16(base::StringPrintf(
71 "Key %s is reserved.", manifest_keys::kSynthesizeExtensionAction)); 71 "Key %s is reserved.", manifest_keys::kSynthesizeExtensionAction));
72 return false; // No one should use this key. 72 return false; // No one should use this key.
73 } 73 }
74 74
75 // Set an empty page action. We use a page action (instead of a browser 75 // Set an empty page action. We use a page action (instead of a browser
76 // action) because the action should not be seen as enabled on every page. 76 // action) because the action should not be seen as enabled on every page.
77 ActionInfo::SetPageActionInfo(extension, new ActionInfo()); 77 scoped_ptr<ActionInfo> action_info(new ActionInfo());
78 action_info->synthesized = true;
79 ActionInfo::SetPageActionInfo(extension, action_info.release());
78 } 80 }
79 81
80 return true; 82 return true;
81 } 83 }
82 84
83 bool ExtensionActionHandler::Validate( 85 bool ExtensionActionHandler::Validate(
84 const Extension* extension, 86 const Extension* extension,
85 std::string* error, 87 std::string* error,
86 std::vector<InstallWarning>* warnings) const { 88 std::vector<InstallWarning>* warnings) const {
87 int error_message = 0; 89 int error_message = 0;
(...skipping 19 matching lines...) Expand all
107 109
108 const std::vector<std::string> ExtensionActionHandler::Keys() const { 110 const std::vector<std::string> ExtensionActionHandler::Keys() const {
109 std::vector<std::string> keys; 111 std::vector<std::string> keys;
110 keys.push_back(manifest_keys::kPageAction); 112 keys.push_back(manifest_keys::kPageAction);
111 keys.push_back(manifest_keys::kBrowserAction); 113 keys.push_back(manifest_keys::kBrowserAction);
112 keys.push_back(manifest_keys::kSynthesizeExtensionAction); 114 keys.push_back(manifest_keys::kSynthesizeExtensionAction);
113 return keys; 115 return keys;
114 } 116 }
115 117
116 } // namespace extensions 118 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/extension_action/action_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698