Commit aa885bd7 authored by robliao's avatar robliao Committed by Commit bot

Google Now Extension Auto Download

Added support to download a finch guided extension for CrOS builds
with the app list extension build bit enabled.

BUG=457335

Review URL: https://codereview.chromium.org/775193003

Cr-Commit-Position: refs/heads/master@{#316334}
parent 78b69286
......@@ -21,6 +21,10 @@
#include "chromeos/chromeos_switches.h"
#endif
#if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS)
#include "chrome/browser/ui/app_list/google_now_extension.h"
#endif
namespace extensions {
ExternalComponentLoader::ExternalComponentLoader(Profile* profile)
......@@ -85,6 +89,14 @@ void ExternalComponentLoader::StartLoading() {
}
#endif
#if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS)
std::string google_now_extension_id;
if (GetGoogleNowExtensionId(&google_now_extension_id)) {
prefs_->SetString(google_now_extension_id + ".external_update_url",
extension_urls::GetWebstoreUpdateUrl().spec());
}
#endif
LoadFinished();
}
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/app_list/google_now_extension.h"
#include "components/variations/variations_associated_data.h"
namespace {
const char kGoogleNowExtensionFieldTrialName[] = "GoogleNowExtension";
}; // namespace
bool GetGoogleNowExtensionId(std::string* extension_id) {
*extension_id = variations::GetVariationParamValue(
kGoogleNowExtensionFieldTrialName, "id");
return !extension_id->empty();
}
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_APP_LIST_GOOGLE_NOW_EXTENSION_H_
#define CHROME_BROWSER_UI_APP_LIST_GOOGLE_NOW_EXTENSION_H_
#include <string>
// Returns true and sets |extension_id| if extension experiment enabled
// false if no experiment or |extension_id| is empty.
bool GetGoogleNowExtensionId(std::string* extension_id);
#endif // CHROME_BROWSER_UI_APP_LIST_GOOGLE_NOW_EXTENSION_H_
......@@ -2364,6 +2364,8 @@
'browser/ui/app_list/extension_uninstaller.h',
'browser/ui/app_list/fast_show_pickler.cc',
'browser/ui/app_list/fast_show_pickler.h',
'browser/ui/app_list/google_now_extension.cc',
'browser/ui/app_list/google_now_extension.h',
'browser/ui/app_list/launcher_page_event_dispatcher.cc',
'browser/ui/app_list/launcher_page_event_dispatcher.h',
'browser/ui/app_list/model_pref_updater.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment