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

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

Issue 8781001: GTK: Port omnibox drawing from GdkGC interface to cairo. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added comment for thakis Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_split.h" 8 #include "base/string_split.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // the extension cannot yet be found via GetExtensionById() if it is 213 // the extension cannot yet be found via GetExtensionById() if it is
214 // installed but not loaded (which may confuse listeners to 214 // installed but not loaded (which may confuse listeners to
215 // BROWSER_THEME_CHANGED). 215 // BROWSER_THEME_CHANGED).
216 registrar_.Add(this, 216 registrar_.Add(this,
217 chrome::NOTIFICATION_EXTENSION_LOADED, 217 chrome::NOTIFICATION_EXTENSION_LOADED,
218 content::Source<Profile>(profile_)); 218 content::Source<Profile>(profile_));
219 219
220 LoadThemePrefs(); 220 LoadThemePrefs();
221 } 221 }
222 222
223 const gfx::Image* ThemeService::GetImageNamed(int id) const {
224 DCHECK(CalledOnValidThread());
225
226 const gfx::Image* image = NULL;
227
228 if (theme_pack_.get())
229 image = theme_pack_->GetImageNamed(id);
230
231 if (!image)
232 image = &rb_.GetNativeImageNamed(id);
233
234 return image;
235 }
236
223 SkBitmap* ThemeService::GetBitmapNamed(int id) const { 237 SkBitmap* ThemeService::GetBitmapNamed(int id) const {
224 DCHECK(CalledOnValidThread()); 238 DCHECK(CalledOnValidThread());
225 239
226 SkBitmap* bitmap = NULL; 240 SkBitmap* bitmap = NULL;
227 241
228 if (theme_pack_.get()) 242 if (theme_pack_.get())
229 bitmap = theme_pack_->GetBitmapNamed(id); 243 bitmap = theme_pack_->GetBitmapNamed(id);
230 244
231 if (!bitmap) 245 if (!bitmap)
232 bitmap = rb_.GetBitmapNamed(id); 246 bitmap = rb_.GetBitmapNamed(id);
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 void ThemeService::OnInfobarDisplayed() { 669 void ThemeService::OnInfobarDisplayed() {
656 number_of_infobars_++; 670 number_of_infobars_++;
657 } 671 }
658 672
659 void ThemeService::OnInfobarDestroyed() { 673 void ThemeService::OnInfobarDestroyed() {
660 number_of_infobars_--; 674 number_of_infobars_--;
661 675
662 if (number_of_infobars_ == 0) 676 if (number_of_infobars_ == 0)
663 RemoveUnusedThemes(); 677 RemoveUnusedThemes();
664 } 678 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_service.h ('k') | chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698