OLD | NEW |
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/location.h" | 10 #include "base/location.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 ~ThemeObserver() override { | 119 ~ThemeObserver() override { |
120 extensions::ExtensionRegistry::Get(theme_service_->profile_) | 120 extensions::ExtensionRegistry::Get(theme_service_->profile_) |
121 ->RemoveObserver(this); | 121 ->RemoveObserver(this); |
122 } | 122 } |
123 | 123 |
124 private: | 124 private: |
125 void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, | 125 void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, |
126 const extensions::Extension* extension, | 126 const extensions::Extension* extension, |
127 bool is_update, | 127 bool is_update, |
128 bool from_ephemeral, | |
129 const std::string& old_name) override { | 128 const std::string& old_name) override { |
130 if (extension->is_theme()) { | 129 if (extension->is_theme()) { |
131 // The theme may be initially disabled. Wait till it is loaded (if ever). | 130 // The theme may be initially disabled. Wait till it is loaded (if ever). |
132 theme_service_->installed_pending_load_id_ = extension->id(); | 131 theme_service_->installed_pending_load_id_ = extension->id(); |
133 } | 132 } |
134 } | 133 } |
135 | 134 |
136 void OnExtensionLoaded(content::BrowserContext* browser_context, | 135 void OnExtensionLoaded(content::BrowserContext* browser_context, |
137 const extensions::Extension* extension) override { | 136 const extensions::Extension* extension) override { |
138 if (extension->is_theme() && | 137 if (extension->is_theme() && |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 void ThemeService::OnInfobarDestroyed() { | 696 void ThemeService::OnInfobarDestroyed() { |
698 number_of_infobars_--; | 697 number_of_infobars_--; |
699 | 698 |
700 if (number_of_infobars_ == 0) | 699 if (number_of_infobars_ == 0) |
701 RemoveUnusedThemes(false); | 700 RemoveUnusedThemes(false); |
702 } | 701 } |
703 | 702 |
704 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { | 703 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { |
705 return theme_syncable_service_.get(); | 704 return theme_syncable_service_.get(); |
706 } | 705 } |
OLD | NEW |