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

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

Issue 502033003: Move ExtensionActionStorageManager out of extension_action_api.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master for CQ Created 6 years, 3 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 (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/extension_action.h" 5 #include "chrome/browser/extensions/extension_action.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 }; 51 };
52 52
53 template <class T> 53 template <class T>
54 bool HasValue(const std::map<int, T>& map, int tab_id) { 54 bool HasValue(const std::map<int, T>& map, int tab_id) {
55 return map.find(tab_id) != map.end(); 55 return map.find(tab_id) != map.end();
56 } 56 }
57 57
58 } // namespace 58 } // namespace
59 59
60 const int ExtensionAction::kDefaultTabId = -1; 60 const int ExtensionAction::kDefaultTabId = -1;
61 const int ExtensionAction::kPageActionIconMaxSize = 19; 61 const int ExtensionAction::kPageActionIconMaxSize =
62 extension_misc::EXTENSION_ICON_ACTION;
62 63
63 ExtensionAction::ExtensionAction(const std::string& extension_id, 64 ExtensionAction::ExtensionAction(const std::string& extension_id,
64 extensions::ActionInfo::Type action_type, 65 extensions::ActionInfo::Type action_type,
65 const extensions::ActionInfo& manifest_data) 66 const extensions::ActionInfo& manifest_data)
66 : extension_id_(extension_id), action_type_(action_type) { 67 : extension_id_(extension_id), action_type_(action_type) {
67 // Page/script actions are hidden/disabled by default, and browser actions are 68 // Page/script actions are hidden/disabled by default, and browser actions are
68 // visible/enabled by default. 69 // visible/enabled by default.
69 SetIsVisible(kDefaultTabId, 70 SetIsVisible(kDefaultTabId,
70 action_type == extensions::ActionInfo::TYPE_BROWSER); 71 action_type == extensions::ActionInfo::TYPE_BROWSER);
71 SetTitle(kDefaultTabId, manifest_data.default_title); 72 SetTitle(kDefaultTabId, manifest_data.default_title);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // If there is a default icon, the icon width will be set depending on our 246 // If there is a default icon, the icon width will be set depending on our
246 // action type. 247 // action type.
247 if (default_icon_) 248 if (default_icon_)
248 return GetIconSizeForType(action_type()); 249 return GetIconSizeForType(action_type());
249 250
250 // If no icon has been set and there is no default icon, we need favicon 251 // If no icon has been set and there is no default icon, we need favicon
251 // width. 252 // width.
252 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( 253 return ui::ResourceBundle::GetSharedInstance().GetImageNamed(
253 IDR_EXTENSIONS_FAVICON).ToImageSkia()->width(); 254 IDR_EXTENSIONS_FAVICON).ToImageSkia()->width();
254 } 255 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698