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

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

Issue 1677303002: Remove win aura theme references (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: increment theme version no Created 4 years, 10 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/app/theme/theme_resources.grd ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.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 3894526d02786b0f944508a8cca9951ad0e159af..628b987b30349a8109a4c95dfc107a903ddb238e 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -48,7 +48,7 @@ namespace {
// Version number of the current theme pack. We just throw out and rebuild
// theme packs that aren't int-equal to this. Increment this number if you
// change default theme assets.
-const int kThemePackVersion = 36;
+const int kThemePackVersion = 37;
// IDs that are in the DataPack won't clash with the positive integer
// uint16_t. kHeaderID should always have the maximum value because we want the
@@ -177,39 +177,6 @@ PersistingImagesTable kPersistingImages[] = {
};
const size_t kPersistingImagesLength = arraysize(kPersistingImages);
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
-// Persistent theme ids for Windows.
-const int PRS_THEME_FRAME_DESKTOP = 100;
-const int PRS_THEME_FRAME_INACTIVE_DESKTOP = 101;
-const int PRS_THEME_FRAME_INCOGNITO_DESKTOP = 102;
-const int PRS_THEME_FRAME_INCOGNITO_INACTIVE_DESKTOP = 103;
-const int PRS_THEME_TOOLBAR_DESKTOP = 104;
-const int PRS_THEME_TAB_BACKGROUND_DESKTOP = 105;
-const int PRS_THEME_TAB_BACKGROUND_INCOGNITO_DESKTOP = 106;
-
-// Persistent theme to resource id mapping for Windows AURA.
-PersistingImagesTable kPersistingImagesDesktopAura[] = {
- { PRS_THEME_FRAME_DESKTOP, IDR_THEME_FRAME_DESKTOP,
- "theme_frame" },
- { PRS_THEME_FRAME_INACTIVE_DESKTOP, IDR_THEME_FRAME_INACTIVE_DESKTOP,
- "theme_frame_inactive" },
- { PRS_THEME_FRAME_INCOGNITO_DESKTOP, IDR_THEME_FRAME_INCOGNITO_DESKTOP,
- "theme_frame_incognito" },
- { PRS_THEME_FRAME_INCOGNITO_INACTIVE_DESKTOP,
- IDR_THEME_FRAME_INCOGNITO_INACTIVE_DESKTOP,
- "theme_frame_incognito_inactive" },
- { PRS_THEME_TOOLBAR_DESKTOP, IDR_THEME_TOOLBAR_DESKTOP,
- "theme_toolbar" },
- { PRS_THEME_TAB_BACKGROUND_DESKTOP, IDR_THEME_TAB_BACKGROUND_DESKTOP,
- "theme_tab_background" },
- { PRS_THEME_TAB_BACKGROUND_INCOGNITO_DESKTOP,
- IDR_THEME_TAB_BACKGROUND_INCOGNITO_DESKTOP,
- "theme_tab_background_incognito" },
-};
-const size_t kPersistingImagesDesktopAuraLength =
- arraysize(kPersistingImagesDesktopAura);
-#endif
-
int GetPersistentIDByNameHelper(const std::string& key,
const PersistingImagesTable* image_table,
size_t image_table_size) {
@@ -236,13 +203,6 @@ int GetPersistentIDByIDR(int idr) {
int prs_id = kPersistingImages[i].persistent_id;
(*lookup_table)[idr] = prs_id;
}
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
- for (size_t i = 0; i < kPersistingImagesDesktopAuraLength; ++i) {
- int idr = kPersistingImagesDesktopAura[i].idr_id;
- int prs_id = kPersistingImagesDesktopAura[i].persistent_id;
- (*lookup_table)[idr] = prs_id;
- }
-#endif
}
std::map<int,int>::iterator it = lookup_table->find(idr);
return (it == lookup_table->end()) ? -1 : it->second;
@@ -256,12 +216,6 @@ int GetMaxPersistentId() {
if (kPersistingImages[i].persistent_id > max_prs_id)
max_prs_id = kPersistingImages[i].persistent_id;
}
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
- for (size_t i = 0; i < kPersistingImagesDesktopAuraLength; ++i) {
- if (kPersistingImagesDesktopAura[i].persistent_id > max_prs_id)
- max_prs_id = kPersistingImagesDesktopAura[i].persistent_id;
- }
-#endif
}
return max_prs_id;
}
@@ -374,13 +328,6 @@ IntToIntTable kFrameTintMap[] = {
{ PRS_THEME_FRAME_INCOGNITO, ThemeProperties::TINT_FRAME_INCOGNITO },
{ PRS_THEME_FRAME_INCOGNITO_INACTIVE,
ThemeProperties::TINT_FRAME_INCOGNITO_INACTIVE },
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
- { PRS_THEME_FRAME_DESKTOP, ThemeProperties::TINT_FRAME },
- { PRS_THEME_FRAME_INACTIVE_DESKTOP, ThemeProperties::TINT_FRAME_INACTIVE },
- { PRS_THEME_FRAME_INCOGNITO_DESKTOP, ThemeProperties::TINT_FRAME_INCOGNITO },
- { PRS_THEME_FRAME_INCOGNITO_INACTIVE_DESKTOP,
- ThemeProperties::TINT_FRAME_INCOGNITO_INACTIVE },
-#endif
};
// Mapping used in GenerateTabBackgroundImages() to associate what frame image
@@ -388,11 +335,6 @@ IntToIntTable kFrameTintMap[] = {
IntToIntTable kTabBackgroundMap[] = {
{ PRS_THEME_TAB_BACKGROUND, PRS_THEME_FRAME },
{ PRS_THEME_TAB_BACKGROUND_INCOGNITO, PRS_THEME_FRAME_INCOGNITO },
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
- { PRS_THEME_TAB_BACKGROUND_DESKTOP, PRS_THEME_FRAME_DESKTOP },
- { PRS_THEME_TAB_BACKGROUND_INCOGNITO_DESKTOP,
- PRS_THEME_FRAME_INCOGNITO_DESKTOP },
-#endif
};
struct CropEntry {
@@ -423,9 +365,6 @@ struct CropEntry kImagesToCrop[] = {
{ PRS_THEME_TOOLBAR, 200, false },
{ PRS_THEME_BUTTON_BACKGROUND, 60, false },
{ PRS_THEME_WINDOW_CONTROL_BACKGROUND, 50, false },
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
- { PRS_THEME_TOOLBAR_DESKTOP, 200, false }
-#endif
};
@@ -793,12 +732,6 @@ bool BrowserThemePack::IsPersistentImageID(int id) {
if (kPersistingImages[i].idr_id == id)
return true;
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
- for (size_t i = 0; i < kPersistingImagesDesktopAuraLength; ++i)
- if (kPersistingImagesDesktopAura[i].idr_id == id)
- return true;
-#endif
-
return false;
}
@@ -1242,13 +1175,6 @@ void BrowserThemePack::AddFileAtScaleToMap(const std::string& image_name,
int id = GetPersistentIDByName(image_name);
if (id != -1)
(*file_paths)[id][scale_factor] = image_path;
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
- id = GetPersistentIDByNameHelper(image_name,
- kPersistingImagesDesktopAura,
- kPersistingImagesDesktopAuraLength);
- if (id != -1)
- (*file_paths)[id][scale_factor] = image_path;
-#endif
}
void BrowserThemePack::BuildSourceImagesArray(const FilePathMap& file_paths) {
@@ -1370,17 +1296,6 @@ void BrowserThemePack::CreateFrameImages(ImageCache* images) const {
// thing and just use the default images.
int prs_base_id = 0;
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
- if (prs_id == PRS_THEME_FRAME_INCOGNITO_INACTIVE_DESKTOP) {
- prs_base_id = images->count(PRS_THEME_FRAME_INCOGNITO_DESKTOP) ?
- PRS_THEME_FRAME_INCOGNITO_DESKTOP : PRS_THEME_FRAME_DESKTOP;
- } else if (prs_id == PRS_THEME_FRAME_INACTIVE_DESKTOP) {
- prs_base_id = PRS_THEME_FRAME_DESKTOP;
- } else if (prs_id == PRS_THEME_FRAME_INCOGNITO_DESKTOP &&
- !images->count(PRS_THEME_FRAME_INCOGNITO_DESKTOP)) {
- prs_base_id = PRS_THEME_FRAME_DESKTOP;
- }
-#endif
if (!prs_base_id) {
if (prs_id == PRS_THEME_FRAME_INCOGNITO_INACTIVE) {
prs_base_id = images->count(PRS_THEME_FRAME_INCOGNITO) ?
@@ -1401,11 +1316,7 @@ void BrowserThemePack::CreateFrameImages(ImageCache* images) const {
} else if (prs_base_id != prs_id && images->count(prs_base_id)) {
frame = (*images)[prs_base_id];
} else if (prs_base_id == PRS_THEME_FRAME_OVERLAY) {
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
- if (images->count(PRS_THEME_FRAME_DESKTOP)) {
-#else
if (images->count(PRS_THEME_FRAME)) {
-#endif
// If there is no theme overlay, don't tint the default frame,
// because it will overwrite the custom frame image when we cache and
// reload from disk.
@@ -1415,12 +1326,6 @@ void BrowserThemePack::CreateFrameImages(ImageCache* images) const {
// If the theme doesn't specify an image, then apply the tint to
// the default frame.
frame = rb.GetImageNamed(IDR_THEME_FRAME);
-#if defined(USE_ASH) && !defined(OS_CHROMEOS)
- if (prs_id >= PRS_THEME_FRAME_DESKTOP &&
- prs_id <= PRS_THEME_FRAME_INCOGNITO_INACTIVE_DESKTOP) {
- frame = rb.GetImageNamed(IDR_THEME_FRAME_DESKTOP);
- }
-#endif
}
if (!frame.IsEmpty()) {
temp_output[prs_id] = CreateHSLShiftedImage(
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698