Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: chrome/browser/extensions/extensions_service.cc

Issue 4658006: Open apps section on NTP when new app get installed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments resolved Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/shown_sections_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/metrics/histogram.h" 12 #include "base/metrics/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 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 extension_prefs_->GetExtensionState(extension->id()); 1683 extension_prefs_->GetExtensionState(extension->id());
1683 initial_state = 1684 initial_state =
1684 (existing_state == Extension::DISABLED) ? 1685 (existing_state == Extension::DISABLED) ?
1685 Extension::DISABLED : Extension::ENABLED; 1686 Extension::DISABLED : Extension::ENABLED;
1686 initial_enable_incognito = 1687 initial_enable_incognito =
1687 extension_prefs_->IsIncognitoEnabled(extension->id()); 1688 extension_prefs_->IsIncognitoEnabled(extension->id());
1688 } 1689 }
1689 1690
1690 UMA_HISTOGRAM_ENUMERATION("Extensions.InstallType", 1691 UMA_HISTOGRAM_ENUMERATION("Extensions.InstallType",
1691 extension->GetHistogramType(), 100); 1692 extension->GetHistogramType(), 100);
1693 ShownSectionsHandler::OnExtensionInstalled(profile_->GetPrefs(), extension);
1692 extension_prefs_->OnExtensionInstalled( 1694 extension_prefs_->OnExtensionInstalled(
1693 extension, initial_state, initial_enable_incognito); 1695 extension, initial_state, initial_enable_incognito);
1694 1696
1695 // Unpacked extensions start off with file access since they are a developer 1697 // Unpacked extensions start off with file access since they are a developer
1696 // feature. 1698 // feature.
1697 if (extension->location() == Extension::LOAD) 1699 if (extension->location() == Extension::LOAD)
1698 extension_prefs_->SetAllowFileAccess(extension->id(), true); 1700 extension_prefs_->SetAllowFileAccess(extension->id(), true);
1699 1701
1700 // If the extension is a theme, tell the profile (and therefore ThemeProvider) 1702 // If the extension is a theme, tell the profile (and therefore ThemeProvider)
1701 // to apply it. 1703 // to apply it.
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1947 } 1949 }
1948 1950
1949 bool ExtensionsService::IsBeingUpgraded(const Extension* extension) { 1951 bool ExtensionsService::IsBeingUpgraded(const Extension* extension) {
1950 return extension_runtime_data_[extension->id()].being_upgraded; 1952 return extension_runtime_data_[extension->id()].being_upgraded;
1951 } 1953 }
1952 1954
1953 void ExtensionsService::SetBeingUpgraded(const Extension* extension, 1955 void ExtensionsService::SetBeingUpgraded(const Extension* extension,
1954 bool value) { 1956 bool value) {
1955 extension_runtime_data_[extension->id()].being_upgraded = value; 1957 extension_runtime_data_[extension->id()].being_upgraded = value;
1956 } 1958 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/shown_sections_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698