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

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

Issue 14694010: Consolidate manifest handler registration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/extensions/extension_service.h" 13 #include "chrome/browser/extensions/extension_service.h"
14 #include "chrome/browser/extensions/extension_system.h" 14 #include "chrome/browser/extensions/extension_system.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/themes/browser_theme_pack.h" 16 #include "chrome/browser/themes/browser_theme_pack.h"
17 #include "chrome/browser/themes/theme_properties.h" 17 #include "chrome/browser/themes/theme_properties.h"
18 #include "chrome/browser/themes/theme_syncable_service.h" 18 #include "chrome/browser/themes/theme_syncable_service.h"
19 #include "chrome/common/chrome_constants.h" 19 #include "chrome/common/chrome_constants.h"
20 #include "chrome/common/chrome_notification_types.h" 20 #include "chrome/common/chrome_notification_types.h"
21 #include "chrome/common/extensions/extension_manifest_constants.h" 21 #include "chrome/common/extensions/extension_manifest_constants.h"
22 #include "chrome/common/extensions/manifest_handler.h"
23 #include "chrome/common/extensions/manifest_handlers/theme_handler.h"
24 #include "chrome/common/pref_names.h" 22 #include "chrome/common/pref_names.h"
25 #include "content/public/browser/notification_service.h" 23 #include "content/public/browser/notification_service.h"
26 #include "content/public/browser/user_metrics.h" 24 #include "content/public/browser/user_metrics.h"
27 #include "grit/theme_resources.h" 25 #include "grit/theme_resources.h"
28 #include "grit/ui_resources.h" 26 #include "grit/ui_resources.h"
29 #include "ui/base/layout.h" 27 #include "ui/base/layout.h"
30 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
31 #include "ui/gfx/image/image_skia.h" 29 #include "ui/gfx/image/image_skia.h"
32 30
33 #if defined(OS_WIN) 31 #if defined(OS_WIN)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 83 }
86 84
87 ThemeService::~ThemeService() { 85 ThemeService::~ThemeService() {
88 FreePlatformCaches(); 86 FreePlatformCaches();
89 } 87 }
90 88
91 void ThemeService::Init(Profile* profile) { 89 void ThemeService::Init(Profile* profile) {
92 DCHECK(CalledOnValidThread()); 90 DCHECK(CalledOnValidThread());
93 profile_ = profile; 91 profile_ = profile;
94 92
95 (new extensions::ThemeHandler)->Register();
96
97 LoadThemePrefs(); 93 LoadThemePrefs();
98 94
99 if (!ready_) { 95 if (!ready_) {
100 registrar_.Add(this, 96 registrar_.Add(this,
101 chrome::NOTIFICATION_EXTENSIONS_READY, 97 chrome::NOTIFICATION_EXTENSIONS_READY,
102 content::Source<Profile>(profile_)); 98 content::Source<Profile>(profile_));
103 } 99 }
104 100
105 theme_syncable_service_.reset(new ThemeSyncableService(profile_, this)); 101 theme_syncable_service_.reset(new ThemeSyncableService(profile_, this));
106 } 102 }
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 void ThemeService::OnInfobarDestroyed() { 419 void ThemeService::OnInfobarDestroyed() {
424 number_of_infobars_--; 420 number_of_infobars_--;
425 421
426 if (number_of_infobars_ == 0) 422 if (number_of_infobars_ == 0)
427 RemoveUnusedThemes(); 423 RemoveUnusedThemes();
428 } 424 }
429 425
430 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { 426 ThemeSyncableService* ThemeService::GetThemeSyncableService() const {
431 return theme_syncable_service_.get(); 427 return theme_syncable_service_.get();
432 } 428 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698