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_system.h" | 5 #include "chrome/browser/extensions/extension_system.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/string_tokenizer.h" | 10 #include "base/string_tokenizer.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/extensions/message_service.h" | 29 #include "chrome/browser/extensions/message_service.h" |
30 #include "chrome/browser/extensions/state_store.h" | 30 #include "chrome/browser/extensions/state_store.h" |
31 #include "chrome/browser/extensions/unpacked_installer.h" | 31 #include "chrome/browser/extensions/unpacked_installer.h" |
32 #include "chrome/browser/extensions/user_script_master.h" | 32 #include "chrome/browser/extensions/user_script_master.h" |
33 #include "chrome/browser/prefs/pref_service.h" | 33 #include "chrome/browser/prefs/pref_service.h" |
34 #include "chrome/browser/profiles/profile.h" | 34 #include "chrome/browser/profiles/profile.h" |
35 #include "chrome/browser/profiles/profile_manager.h" | 35 #include "chrome/browser/profiles/profile_manager.h" |
36 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 36 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
37 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 37 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
| 39 #include "chrome/common/chrome_version_info.h" |
39 #include "chrome/common/extensions/extension.h" | 40 #include "chrome/common/extensions/extension.h" |
40 #include "chrome/common/extensions/features/feature.h" | 41 #include "chrome/common/extensions/features/feature.h" |
41 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
42 #include "content/public/browser/browser_thread.h" | 43 #include "content/public/browser/browser_thread.h" |
43 | 44 |
44 using content::BrowserThread; | 45 using content::BrowserThread; |
45 | 46 |
46 namespace extensions { | 47 namespace extensions { |
47 | 48 |
48 // | 49 // |
49 // ExtensionSystem | 50 // ExtensionSystem |
50 // | 51 // |
51 | 52 |
52 ExtensionSystem::ExtensionSystem() { | 53 ExtensionSystem::ExtensionSystem() { |
53 // In lieu of a way for Feature to check whether it's running on the browser | 54 Feature::SetCurrentChannel(chrome::VersionInfo::GetChannel()); |
54 // process, tell it. | |
55 // See http://crbug.com/126535. | |
56 Feature::SetChannelCheckingEnabled(true); | |
57 } | 55 } |
58 | 56 |
59 ExtensionSystem::~ExtensionSystem() { | 57 ExtensionSystem::~ExtensionSystem() { |
60 } | 58 } |
61 | 59 |
62 // static | 60 // static |
63 ExtensionSystem* ExtensionSystem::Get(Profile* profile) { | 61 ExtensionSystem* ExtensionSystem::Get(Profile* profile) { |
64 return ExtensionSystemFactory::GetForProfile(profile); | 62 return ExtensionSystemFactory::GetForProfile(profile); |
65 } | 63 } |
66 | 64 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 376 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
379 const std::string& extension_id, | 377 const std::string& extension_id, |
380 const extension_misc::UnloadedExtensionReason reason) { | 378 const extension_misc::UnloadedExtensionReason reason) { |
381 BrowserThread::PostTask( | 379 BrowserThread::PostTask( |
382 BrowserThread::IO, FROM_HERE, | 380 BrowserThread::IO, FROM_HERE, |
383 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 381 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
384 extension_id, reason)); | 382 extension_id, reason)); |
385 } | 383 } |
386 | 384 |
387 } // namespace extensions | 385 } // namespace extensions |
OLD | NEW |