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

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

Issue 324393002: Extension Toolbar redesign, part 1 (overflow) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missing gypi change Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/common/extensions/manifest_handlers/synthesize_browser_action_h andler.h"
6
7 #include "chrome/common/extensions/api/extension_action/action_info.h"
8 #include "extensions/common/feature_switch.h"
9 #include "extensions/common/manifest_constants.h"
10
11 namespace extensions {
12
13 SynthesizeBrowserActionHandler::SynthesizeBrowserActionHandler() {
14 }
15
16 SynthesizeBrowserActionHandler::~SynthesizeBrowserActionHandler() {
17 }
18
19 bool SynthesizeBrowserActionHandler::Parse(Extension* extension,
20 base::string16* error) {
21 if (!extensions::FeatureSwitch::extension_action_redesign()->IsEnabled())
22 return true; // Do nothing.
23
24 if (extension->location() == Manifest::COMPONENT ||
25 extension->location() == Manifest::EXTERNAL_COMPONENT)
26 return true; // Return no error (we're done).
27
28 if (extension->manifest()->HasKey(manifest_keys::kSynthesizeBrowserAction))
29 return false; // This key is reserved, no extension should be using it.
30
31 // TODO(devlin): Make sure we don't have two icons showing for page action
32 // extensions if we show page action icons in the browser action
33 // toolbar.
34 if (!extension->manifest()->HasKey(manifest_keys::kBrowserAction))
35 ActionInfo::SetBrowserActionInfo(extension, new ActionInfo());
36
37 return true;
38 }
39
40 bool SynthesizeBrowserActionHandler::AlwaysParseForType(
41 Manifest::Type type) const {
42 return type == Manifest::TYPE_EXTENSION;
43 }
44
45 const std::vector<std::string> SynthesizeBrowserActionHandler::Keys() const {
46 return SingleKey(manifest_keys::kSynthesizeBrowserAction);
47 }
48
49 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/manifest_handlers/synthesize_browser_action_handler.h ('k') | extensions/common/feature_switch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698