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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 extension_paths[info->at(i)->extension_id] = info->at(i)->extension_path; | 1866 extension_paths[info->at(i)->extension_id] = info->at(i)->extension_path; |
1867 | 1867 |
1868 if (!BrowserThread::PostTask( | 1868 if (!BrowserThread::PostTask( |
1869 BrowserThread::FILE, FROM_HERE, | 1869 BrowserThread::FILE, FROM_HERE, |
1870 base::Bind( | 1870 base::Bind( |
1871 &extension_file_util::GarbageCollectExtensions, | 1871 &extension_file_util::GarbageCollectExtensions, |
1872 install_directory_, | 1872 install_directory_, |
1873 extension_paths))) | 1873 extension_paths))) |
1874 NOTREACHED(); | 1874 NOTREACHED(); |
1875 | 1875 |
| 1876 #if defined(ENABLE_THEMES) |
1876 // Also garbage-collect themes. We check |profile_| to be | 1877 // Also garbage-collect themes. We check |profile_| to be |
1877 // defensive; in the future, we may call GarbageCollectExtensions() | 1878 // defensive; in the future, we may call GarbageCollectExtensions() |
1878 // from somewhere other than Init() (e.g., in a timer). | 1879 // from somewhere other than Init() (e.g., in a timer). |
1879 if (profile_) { | 1880 if (profile_) { |
1880 ThemeServiceFactory::GetForProfile(profile_)->RemoveUnusedThemes(); | 1881 ThemeServiceFactory::GetForProfile(profile_)->RemoveUnusedThemes(); |
1881 } | 1882 } |
| 1883 #endif |
1882 } | 1884 } |
1883 | 1885 |
1884 void ExtensionService::SyncExtensionChangeIfNeeded(const Extension& extension) { | 1886 void ExtensionService::SyncExtensionChangeIfNeeded(const Extension& extension) { |
1885 if (app_sync_bundle_.HandlesApp(extension)) { | 1887 if (app_sync_bundle_.HandlesApp(extension)) { |
1886 app_sync_bundle_.SyncChangeIfNeeded(extension); | 1888 app_sync_bundle_.SyncChangeIfNeeded(extension); |
1887 } else if (extension_sync_bundle_.HandlesExtension(extension)) { | 1889 } else if (extension_sync_bundle_.HandlesExtension(extension)) { |
1888 extension_sync_bundle_.SyncChangeIfNeeded(extension); | 1890 extension_sync_bundle_.SyncChangeIfNeeded(extension); |
1889 } | 1891 } |
1890 } | 1892 } |
1891 | 1893 |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2560 | 2562 |
2561 // To coexist with certain unit tests that don't have a work-thread message | 2563 // To coexist with certain unit tests that don't have a work-thread message |
2562 // loop available at ExtensionService shutdown, we lazy-initialize this | 2564 // loop available at ExtensionService shutdown, we lazy-initialize this |
2563 // object so that those cases neither create nor destroy an | 2565 // object so that those cases neither create nor destroy an |
2564 // APIResourceController. | 2566 // APIResourceController. |
2565 if (!api_resource_controller_.get()) { | 2567 if (!api_resource_controller_.get()) { |
2566 api_resource_controller_.reset(new extensions::APIResourceController()); | 2568 api_resource_controller_.reset(new extensions::APIResourceController()); |
2567 } | 2569 } |
2568 return api_resource_controller_.get(); | 2570 return api_resource_controller_.get(); |
2569 } | 2571 } |
OLD | NEW |