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

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

Issue 1214243003: [Extensions UI] Clean up extension icon generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/skia/ImageSkia Created 5 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
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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 if (const bool* default_is_visible = 172 if (const bool* default_is_visible =
173 FindOrNull(&is_visible_, kDefaultTabId)) 173 FindOrNull(&is_visible_, kDefaultTabId))
174 return *default_is_visible; 174 return *default_is_visible;
175 175
176 return false; 176 return false;
177 } 177 }
178 178
179 // Remove all tab-specific state. 179 // Remove all tab-specific state.
180 void ClearAllValuesForTab(int tab_id); 180 void ClearAllValuesForTab(int tab_id);
181 181
182 // If the specified tab has a badge, paint it into the provided bounds.
183 void PaintBadge(gfx::Canvas* canvas, const gfx::Rect& bounds, int tab_id);
184
185 // Returns icon image with badge for specified tab.
186 gfx::ImageSkia GetIconWithBadge(const gfx::ImageSkia& icon,
187 int tab_id,
188 const gfx::Size& spacing) const;
189
190 // Lazily loads and returns the default icon image, if one exists for the 182 // Lazily loads and returns the default icon image, if one exists for the
191 // action. 183 // action.
192 extensions::IconImage* LoadDefaultIconImage( 184 extensions::IconImage* LoadDefaultIconImage(
193 const extensions::Extension& extension, 185 const extensions::Extension& extension,
194 content::BrowserContext* browser_context); 186 content::BrowserContext* browser_context);
195 187
196 // Returns the image to use as the default icon for the action. Can only be 188 // Returns the image to use as the default icon for the action. Can only be
197 // called after LoadDefaultIconImage(). 189 // called after LoadDefaultIconImage().
198 gfx::Image GetDefaultIconImage() const; 190 gfx::Image GetDefaultIconImage() const;
199 191
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 }; 295 };
304 296
305 template<> 297 template<>
306 struct ExtensionAction::ValueTraits<int> { 298 struct ExtensionAction::ValueTraits<int> {
307 static int CreateEmpty() { 299 static int CreateEmpty() {
308 return -1; 300 return -1;
309 } 301 }
310 }; 302 };
311 303
312 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ 304 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698