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

Unified Diff: chrome/browser/themes/browser_theme_pack.cc

Issue 19471005: Add custom default theme support and create a managed user default theme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't call NotifyThemeChanged if not ready. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.h ('k') | chrome/browser/themes/browser_theme_pack_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/browser_theme_pack.cc
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index d6340cb95a5f5eed62ecb70afebabb3df73a4653..988450ed95488717afee60735f164790046d14ec 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -29,6 +29,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/canvas_image_source.h"
+#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/screen.h"
@@ -762,6 +763,21 @@ scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromDataPack(
return pack;
}
+// static
+void BrowserThemePack::GetThemeableImageIDRs(std::set<int>* result) {
+ if (!result)
+ return;
+
+ result->clear();
+ for (size_t i = 0; i < kPersistingImagesLength; ++i)
+ result->insert(kPersistingImages[i].idr_id);
+
+#if defined(OS_WIN) && defined(USE_AURA)
+ for (size_t i = 0; i < kPersistingImagesWinDesktopAuraLength; ++i)
+ result->insert(kPersistingImagesWinDesktopAura[i].idr_id);
+#endif
+}
+
bool BrowserThemePack::WriteToDisk(const base::FilePath& path) const {
// Add resources for each of the property arrays.
RawDataForWriting resources;
@@ -890,21 +906,6 @@ base::RefCountedMemory* BrowserThemePack::GetRawData(
return memory;
}
-// static
-void BrowserThemePack::GetThemeableImageIDRs(std::set<int>* result) {
- if (!result)
- return;
-
- result->clear();
- for (size_t i = 0; i < kPersistingImagesLength; ++i)
- result->insert(kPersistingImages[i].idr_id);
-
-#if defined(OS_WIN) && defined(USE_AURA)
- for (size_t i = 0; i < kPersistingImagesWinDesktopAuraLength; ++i)
- result->insert(kPersistingImagesWinDesktopAura[i].idr_id);
-#endif
-}
-
bool BrowserThemePack::HasCustomImage(int idr_id) const {
int prs_id = GetPersistentIDByIDR(idr_id);
if (prs_id == -1)
@@ -922,7 +923,8 @@ bool BrowserThemePack::HasCustomImage(int idr_id) const {
// private:
BrowserThemePack::BrowserThemePack()
- : header_(NULL),
+ : CustomThemeSupplier(EXTENSION),
+ header_(NULL),
tints_(NULL),
colors_(NULL),
display_properties_(NULL),
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.h ('k') | chrome/browser/themes/browser_theme_pack_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698