Home | History | Annotate | Download | only in extensions
      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
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/extensions/external_component_loader.h"
      6 
      7 #include "base/command_line.h"
      8 #include "base/values.h"
      9 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
     10 #include "chrome/common/chrome_switches.h"
     11 #include "chrome/common/extensions/extension_constants.h"
     12 
     13 namespace extensions {
     14 
     15 ExternalComponentLoader::ExternalComponentLoader() {}
     16 
     17 ExternalComponentLoader::~ExternalComponentLoader() {}
     18 
     19 void ExternalComponentLoader::StartLoading() {
     20   prefs_.reset(new base::DictionaryValue());
     21   std::string appId = extension_misc::kInAppPaymentsSupportAppId;
     22   prefs_->SetString(appId + ".external_update_url",
     23                     extension_urls::GetWebstoreUpdateUrl().spec());
     24 
     25   if (CommandLine::ForCurrentProcess()->
     26           GetSwitchValueASCII(switches::kEnableEnhancedBookmarks) != "0") {
     27     std::string ext_id = GetEnhancedBookmarksExtensionId();
     28     if (!ext_id.empty()) {
     29       prefs_->SetString(ext_id + ".external_update_url",
     30                         extension_urls::GetWebstoreUpdateUrl().spec());
     31     }
     32   }
     33   LoadFinished();
     34 }
     35 
     36 }  // namespace extensions
     37