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

Side by Side Diff: chrome/browser/themes/theme_service.cc

Issue 747013003: Various optimizations to reduce the number of temporary allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Responded to comments. Created 6 years 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
« no previous file with comments | « chrome/browser/themes/theme_properties.cc ('k') | chrome/browser/ui/prefs/prefs_tab_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/themes/theme_service.h" 5 #include "chrome/browser/themes/theme_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 if (HasCustomImage(IDR_THEME_FRAME)) 229 if (HasCustomImage(IDR_THEME_FRAME))
230 return false; 230 return false;
231 #if defined(OS_WIN) 231 #if defined(OS_WIN)
232 return ui::win::IsAeroGlassEnabled(); 232 return ui::win::IsAeroGlassEnabled();
233 #else 233 #else
234 return false; 234 return false;
235 #endif 235 #endif
236 } 236 }
237 237
238 bool ThemeService::HasCustomImage(int id) const { 238 bool ThemeService::HasCustomImage(int id) const {
239 if (!Properties::IsThemeableImage(id)) 239 if (!BrowserThemePack::IsPersistentImageID(id))
Peter Kasting 2014/12/03 22:08:38 Optional: While you're here, a shorter way would b
240 return false; 240 return false;
241 241
242 if (theme_supplier_.get()) 242 if (theme_supplier_.get())
243 return theme_supplier_->HasCustomImage(id); 243 return theme_supplier_->HasCustomImage(id);
244 244
245 return false; 245 return false;
246 } 246 }
247 247
248 base::RefCountedMemory* ThemeService::GetRawData( 248 base::RefCountedMemory* ThemeService::GetRawData(
249 int id, 249 int id,
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 void ThemeService::OnInfobarDestroyed() { 634 void ThemeService::OnInfobarDestroyed() {
635 number_of_infobars_--; 635 number_of_infobars_--;
636 636
637 if (number_of_infobars_ == 0) 637 if (number_of_infobars_ == 0)
638 RemoveUnusedThemes(false); 638 RemoveUnusedThemes(false);
639 } 639 }
640 640
641 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { 641 ThemeSyncableService* ThemeService::GetThemeSyncableService() const {
642 return theme_syncable_service_.get(); 642 return theme_syncable_service_.get();
643 } 643 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_properties.cc ('k') | chrome/browser/ui/prefs/prefs_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698