OLD | NEW |
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" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 if (HotwordServiceFactory::IsHotwordAllowed(profile_)) { | 59 if (HotwordServiceFactory::IsHotwordAllowed(profile_)) { |
60 std::string hotword_id = extension_misc::kHotwordExtensionId; | 60 std::string hotword_id = extension_misc::kHotwordExtensionId; |
61 if (HotwordService::IsExperimentalHotwordingEnabled()) { | 61 if (HotwordService::IsExperimentalHotwordingEnabled()) { |
62 hotword_id = extension_misc::kHotwordSharedModuleId; | 62 hotword_id = extension_misc::kHotwordSharedModuleId; |
63 } | 63 } |
64 prefs_->SetString(hotword_id + ".external_update_url", | 64 prefs_->SetString(hotword_id + ".external_update_url", |
65 extension_urls::GetWebstoreUpdateUrl().spec()); | 65 extension_urls::GetWebstoreUpdateUrl().spec()); |
66 } | 66 } |
67 | 67 |
68 InitBookmarksExperimentState(profile_); | |
69 | |
70 { | 68 { |
71 std::string extension_id; | 69 std::string extension_id; |
72 if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(), | 70 if (GetBookmarksExperimentExtensionID(&extension_id)) { |
73 &extension_id) && | |
74 !extension_id.empty()) { | |
75 prefs_->SetString(extension_id + ".external_update_url", | 71 prefs_->SetString(extension_id + ".external_update_url", |
76 extension_urls::GetWebstoreUpdateUrl().spec()); | 72 extension_urls::GetWebstoreUpdateUrl().spec()); |
77 } | 73 } |
78 } | 74 } |
79 | 75 |
80 #if defined(OS_CHROMEOS) | 76 #if defined(OS_CHROMEOS) |
81 { | 77 { |
82 base::CommandLine* const command_line = | 78 base::CommandLine* const command_line = |
83 base::CommandLine::ForCurrentProcess(); | 79 base::CommandLine::ForCurrentProcess(); |
84 if (!command_line->HasSwitch(chromeos::switches::kDisableNewZIPUnpacker)) { | 80 if (!command_line->HasSwitch(chromeos::switches::kDisableNewZIPUnpacker)) { |
85 const std::string extension_id = extension_misc::kZIPUnpackerExtensionId; | 81 const std::string extension_id = extension_misc::kZIPUnpackerExtensionId; |
86 prefs_->SetString(extension_id + ".external_update_url", | 82 prefs_->SetString(extension_id + ".external_update_url", |
87 extension_urls::GetWebstoreUpdateUrl().spec()); | 83 extension_urls::GetWebstoreUpdateUrl().spec()); |
88 } | 84 } |
89 } | 85 } |
90 #endif | 86 #endif |
91 | 87 |
92 #if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS) | 88 #if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS) |
93 std::string google_now_extension_id; | 89 std::string google_now_extension_id; |
94 if (GetGoogleNowExtensionId(&google_now_extension_id)) { | 90 if (GetGoogleNowExtensionId(&google_now_extension_id)) { |
95 prefs_->SetString(google_now_extension_id + ".external_update_url", | 91 prefs_->SetString(google_now_extension_id + ".external_update_url", |
96 extension_urls::GetWebstoreUpdateUrl().spec()); | 92 extension_urls::GetWebstoreUpdateUrl().spec()); |
97 } | 93 } |
98 #endif | 94 #endif |
99 | 95 |
100 LoadFinished(); | 96 LoadFinished(); |
101 } | 97 } |
102 | 98 |
103 } // namespace extensions | 99 } // namespace extensions |
OLD | NEW |