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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/histogram.h" | 12 #include "base/histogram.h" |
13 #include "base/stl_util-inl.h" | 13 #include "base/stl_util-inl.h" |
14 #include "base/string16.h" | 14 #include "base/string16.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/stringprintf.h" | 17 #include "base/stringprintf.h" |
18 #include "base/time.h" | 18 #include "base/time.h" |
19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
20 #include "base/values.h" | 20 #include "base/values.h" |
21 #include "base/version.h" | 21 #include "base/version.h" |
22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
23 #include "chrome/browser/browser_thread.h" | 23 #include "chrome/browser/browser_thread.h" |
24 #include "chrome/browser/debugger/devtools_manager.h" | 24 #include "chrome/browser/debugger/devtools_manager.h" |
| 25 #include "chrome/browser/dom_ui/shown_sections_handler.h" |
25 #include "chrome/browser/extensions/crx_installer.h" | 26 #include "chrome/browser/extensions/crx_installer.h" |
26 #include "chrome/browser/extensions/default_apps.h" | 27 #include "chrome/browser/extensions/default_apps.h" |
27 #include "chrome/browser/extensions/extension_accessibility_api.h" | 28 #include "chrome/browser/extensions/extension_accessibility_api.h" |
28 #include "chrome/browser/extensions/extension_bookmarks_module.h" | 29 #include "chrome/browser/extensions/extension_bookmarks_module.h" |
29 #include "chrome/browser/extensions/extension_browser_event_router.h" | 30 #include "chrome/browser/extensions/extension_browser_event_router.h" |
30 #include "chrome/browser/extensions/extension_cookies_api.h" | 31 #include "chrome/browser/extensions/extension_cookies_api.h" |
31 #include "chrome/browser/extensions/extension_data_deleter.h" | 32 #include "chrome/browser/extensions/extension_data_deleter.h" |
32 #include "chrome/browser/extensions/extension_dom_ui.h" | 33 #include "chrome/browser/extensions/extension_dom_ui.h" |
33 #include "chrome/browser/extensions/extension_error_reporter.h" | 34 #include "chrome/browser/extensions/extension_error_reporter.h" |
34 #include "chrome/browser/extensions/extension_history_api.h" | 35 #include "chrome/browser/extensions/extension_history_api.h" |
(...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1644 extension_prefs_->GetExtensionState(extension->id()); | 1645 extension_prefs_->GetExtensionState(extension->id()); |
1645 initial_state = | 1646 initial_state = |
1646 (existing_state == Extension::DISABLED) ? | 1647 (existing_state == Extension::DISABLED) ? |
1647 Extension::DISABLED : Extension::ENABLED; | 1648 Extension::DISABLED : Extension::ENABLED; |
1648 initial_enable_incognito = | 1649 initial_enable_incognito = |
1649 extension_prefs_->IsIncognitoEnabled(extension->id()); | 1650 extension_prefs_->IsIncognitoEnabled(extension->id()); |
1650 } | 1651 } |
1651 | 1652 |
1652 UMA_HISTOGRAM_ENUMERATION("Extensions.InstallType", | 1653 UMA_HISTOGRAM_ENUMERATION("Extensions.InstallType", |
1653 extension->GetHistogramType(), 100); | 1654 extension->GetHistogramType(), 100); |
| 1655 ShownSectionsHandler::OnExtensionInstalled(profile_->GetPrefs(), extension); |
1654 extension_prefs_->OnExtensionInstalled( | 1656 extension_prefs_->OnExtensionInstalled( |
1655 extension, initial_state, initial_enable_incognito); | 1657 extension, initial_state, initial_enable_incognito); |
1656 | 1658 |
1657 // Unpacked extensions start off with file access since they are a developer | 1659 // Unpacked extensions start off with file access since they are a developer |
1658 // feature. | 1660 // feature. |
1659 if (extension->location() == Extension::LOAD) | 1661 if (extension->location() == Extension::LOAD) |
1660 extension_prefs_->SetAllowFileAccess(extension->id(), true); | 1662 extension_prefs_->SetAllowFileAccess(extension->id(), true); |
1661 | 1663 |
1662 // If the extension is a theme, tell the profile (and therefore ThemeProvider) | 1664 // If the extension is a theme, tell the profile (and therefore ThemeProvider) |
1663 // to apply it. | 1665 // to apply it. |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 ExtensionIdSet ExtensionsService::GetAppIds() const { | 1889 ExtensionIdSet ExtensionsService::GetAppIds() const { |
1888 ExtensionIdSet result; | 1890 ExtensionIdSet result; |
1889 for (ExtensionList::const_iterator it = extensions_.begin(); | 1891 for (ExtensionList::const_iterator it = extensions_.begin(); |
1890 it != extensions_.end(); ++it) { | 1892 it != extensions_.end(); ++it) { |
1891 if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT) | 1893 if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT) |
1892 result.insert((*it)->id()); | 1894 result.insert((*it)->id()); |
1893 } | 1895 } |
1894 | 1896 |
1895 return result; | 1897 return result; |
1896 } | 1898 } |
OLD | NEW |