| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions_service.h" | 5 #include "chrome/browser/extensions/extensions_service.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 extension_prefs_->GetExtensionState(extension->id()); | 968 extension_prefs_->GetExtensionState(extension->id()); |
| 969 initial_state = | 969 initial_state = |
| 970 (existing_state == Extension::DISABLED) ? | 970 (existing_state == Extension::DISABLED) ? |
| 971 Extension::DISABLED : Extension::ENABLED; | 971 Extension::DISABLED : Extension::ENABLED; |
| 972 initial_enable_incognito = false; | 972 initial_enable_incognito = false; |
| 973 } | 973 } |
| 974 | 974 |
| 975 extension_prefs_->OnExtensionInstalled( | 975 extension_prefs_->OnExtensionInstalled( |
| 976 extension, initial_state, initial_enable_incognito); | 976 extension, initial_state, initial_enable_incognito); |
| 977 | 977 |
| 978 // Unpacked extensions start off with file access since they are a developer |
| 979 // feature. |
| 980 if (extension->location() == Extension::LOAD) |
| 981 extension_prefs_->SetAllowFileAccess(extension->id(), true); |
| 982 |
| 978 // If the extension is a theme, tell the profile (and therefore ThemeProvider) | 983 // If the extension is a theme, tell the profile (and therefore ThemeProvider) |
| 979 // to apply it. | 984 // to apply it. |
| 980 if (extension->is_theme()) { | 985 if (extension->is_theme()) { |
| 981 NotificationService::current()->Notify( | 986 NotificationService::current()->Notify( |
| 982 NotificationType::THEME_INSTALLED, | 987 NotificationType::THEME_INSTALLED, |
| 983 Source<Profile>(profile_), | 988 Source<Profile>(profile_), |
| 984 Details<Extension>(extension)); | 989 Details<Extension>(extension)); |
| 985 } else { | 990 } else { |
| 986 NotificationService::current()->Notify( | 991 NotificationService::current()->Notify( |
| 987 NotificationType::EXTENSION_INSTALLED, | 992 NotificationType::EXTENSION_INSTALLED, |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 // Finish installing on UI thread. | 1325 // Finish installing on UI thread. |
| 1321 ChromeThread::PostTask( | 1326 ChromeThread::PostTask( |
| 1322 ChromeThread::UI, FROM_HERE, | 1327 ChromeThread::UI, FROM_HERE, |
| 1323 NewRunnableMethod( | 1328 NewRunnableMethod( |
| 1324 frontend_, | 1329 frontend_, |
| 1325 &ExtensionsService::ContinueLoadAllExtensions, | 1330 &ExtensionsService::ContinueLoadAllExtensions, |
| 1326 extensions_to_reload, | 1331 extensions_to_reload, |
| 1327 start_time, | 1332 start_time, |
| 1328 true)); | 1333 true)); |
| 1329 } | 1334 } |
| OLD | NEW |