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

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

Issue 775193003: Google Now Extension Auto Download (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply Renames Created 5 years, 10 months 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
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/google_now_extension.h » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/external_component_loader.h" 5 #include "chrome/browser/extensions/external_component_loader.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" 8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/search/hotword_service.h" 10 #include "chrome/browser/search/hotword_service.h"
11 #include "chrome/browser/search/hotword_service_factory.h" 11 #include "chrome/browser/search/hotword_service_factory.h"
12 #include "chrome/browser/signin/signin_manager_factory.h" 12 #include "chrome/browser/signin/signin_manager_factory.h"
13 #include "chrome/common/extensions/extension_constants.h" 13 #include "chrome/common/extensions/extension_constants.h"
14 #include "components/signin/core/browser/signin_manager.h" 14 #include "components/signin/core/browser/signin_manager.h"
15 #include "extensions/common/extension.h" 15 #include "extensions/common/extension.h"
16 #include "extensions/common/extension_urls.h" 16 #include "extensions/common/extension_urls.h"
17 #include "extensions/common/features/simple_feature.h" 17 #include "extensions/common/features/simple_feature.h"
18 18
19 #if defined(OS_CHROMEOS) 19 #if defined(OS_CHROMEOS)
20 #include "base/command_line.h" 20 #include "base/command_line.h"
21 #include "chromeos/chromeos_switches.h" 21 #include "chromeos/chromeos_switches.h"
22 #endif 22 #endif
23 23
24 #if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS)
25 #include "chrome/browser/ui/app_list/google_now_extension.h"
26 #endif
27
24 namespace extensions { 28 namespace extensions {
25 29
26 ExternalComponentLoader::ExternalComponentLoader(Profile* profile) 30 ExternalComponentLoader::ExternalComponentLoader(Profile* profile)
27 : profile_(profile) { 31 : profile_(profile) {
28 } 32 }
29 33
30 ExternalComponentLoader::~ExternalComponentLoader() {} 34 ExternalComponentLoader::~ExternalComponentLoader() {}
31 35
32 // static 36 // static
33 bool ExternalComponentLoader::IsModifiable(const Extension* extension) { 37 bool ExternalComponentLoader::IsModifiable(const Extension* extension) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 base::CommandLine* const command_line = 82 base::CommandLine* const command_line =
79 base::CommandLine::ForCurrentProcess(); 83 base::CommandLine::ForCurrentProcess();
80 if (!command_line->HasSwitch(chromeos::switches::kDisableNewZIPUnpacker)) { 84 if (!command_line->HasSwitch(chromeos::switches::kDisableNewZIPUnpacker)) {
81 const std::string extension_id = extension_misc::kZIPUnpackerExtensionId; 85 const std::string extension_id = extension_misc::kZIPUnpackerExtensionId;
82 prefs_->SetString(extension_id + ".external_update_url", 86 prefs_->SetString(extension_id + ".external_update_url",
83 extension_urls::GetWebstoreUpdateUrl().spec()); 87 extension_urls::GetWebstoreUpdateUrl().spec());
84 } 88 }
85 } 89 }
86 #endif 90 #endif
87 91
92 #if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS)
93 std::string google_now_extension_id;
94 if (GetGoogleNowExtensionId(&google_now_extension_id)) {
95 prefs_->SetString(google_now_extension_id + ".external_update_url",
96 extension_urls::GetWebstoreUpdateUrl().spec());
97 }
98 #endif
99
88 LoadFinished(); 100 LoadFinished();
89 } 101 }
90 102
91 } // namespace extensions 103 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/google_now_extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698