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

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

Issue 68173031: Added enhanced bookmarks extension as an external component extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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/command_line.h"
8 #include "base/metrics/field_trial.h"
7 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/chrome_switches.h"
8 #include "chrome/common/extensions/extension_constants.h" 11 #include "chrome/common/extensions/extension_constants.h"
12 #include "components/variations/variations_associated_data.h"
13 #include "extensions/common/features/feature.h"
14 #include "extensions/common/features/feature_provider.h"
9 15
10 namespace extensions { 16 namespace extensions {
11 17
12 ExternalComponentLoader::ExternalComponentLoader() {} 18 ExternalComponentLoader::ExternalComponentLoader() {}
13 19
14 ExternalComponentLoader::~ExternalComponentLoader() {} 20 ExternalComponentLoader::~ExternalComponentLoader() {}
15 21
16 void ExternalComponentLoader::StartLoading() { 22 void ExternalComponentLoader::StartLoading() {
17 prefs_.reset(new base::DictionaryValue()); 23 prefs_.reset(new base::DictionaryValue());
18 std::string appId = extension_misc::kInAppPaymentsSupportAppId; 24 std::string appId = extension_misc::kInAppPaymentsSupportAppId;
19 prefs_->SetString(appId + ".external_update_url", 25 prefs_->SetString(appId + ".external_update_url",
20 extension_urls::GetWebstoreUpdateUrl().spec()); 26 extension_urls::GetWebstoreUpdateUrl().spec());
27
28 const char kFieldTrialName[] = "EnhancedBookmarks";
29 const char kFieldTrialDefaultGroupName[] = "Default";
30 std::string field_trial_group_name =
31 base::FieldTrialList::FindFullName(kFieldTrialName);
32 if (!field_trial_group_name.empty() &&
33 field_trial_group_name != kFieldTrialDefaultGroupName &&
34 !CommandLine::ForCurrentProcess()->HasSwitch(
35 switches::kDisableEnhancedBookmarks)) {
36 appId = chrome_variations::GetVariationParamValue(kFieldTrialName, "id");
37 FeatureProvider* feature_provider =
38 FeatureProvider::GetPermissionFeatures();
39 Feature* feature = feature_provider->GetFeature("metricsPrivate");
40 if (feature && feature->IsIdInWhitelist(appId)) {
41 prefs_->SetString(appId + ".external_update_url",
42 extension_urls::GetWebstoreUpdateUrl().spec());
43 }
44 }
21 LoadFinished(); 45 LoadFinished();
22 } 46 }
23 47
24 } // namespace extensions 48 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698