Chromium Code Reviews| Index: chrome/browser/android/webapk/webapk_installer.cc |
| diff --git a/chrome/browser/android/webapk/webapk_installer.cc b/chrome/browser/android/webapk/webapk_installer.cc |
| index bb9e030916de819706c9df62fcac2f8e18429aad..144f3130787a9f299addc86cc68aedaea9ca71d9 100644 |
| --- a/chrome/browser/android/webapk/webapk_installer.cc |
| +++ b/chrome/browser/android/webapk/webapk_installer.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/android/jni_string.h" |
| #include "base/android/path_utils.h" |
| #include "base/bind.h" |
| +#include "base/command_line.h" |
| #include "base/files/file_path.h" |
| #include "base/files/file_util.h" |
| #include "base/memory/ref_counted.h" |
| @@ -17,12 +18,11 @@ |
| #include "base/strings/utf_string_conversions.h" |
| #include "base/task_runner_util.h" |
| #include "base/threading/sequenced_worker_pool.h" |
| -#include "chrome/browser/android/chrome_feature_list.h" |
| #include "chrome/browser/android/shortcut_helper.h" |
| #include "chrome/browser/android/webapk/webapk.pb.h" |
| #include "chrome/browser/android/webapk/webapk_icon_hasher.h" |
| #include "chrome/browser/profiles/profile.h" |
| -#include "components/variations/variations_associated_data.h" |
| +#include "chrome/common/chrome_switches.h" |
| #include "components/version_info/version_info.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/common/manifest_util.h" |
| @@ -36,10 +36,7 @@ namespace { |
| // The default WebAPK server URL. |
| const char kDefaultServerUrl[] = |
| - "https://webapk.googleapis.com/v1alpha/webApks/?alt=proto"; |
| - |
| -// Flag for setting the WebAPK server URL. |
| -const char kServerUrlVariationsParamKey[] = "ServerUrl"; |
| + "https://test-webapk.sandbox.googleapis.com/v1/webApks/?alt=proto&key=AIzaSyAoI6v-F31-3t9NunLYEiKcPIqgTJIUZBw"; |
| // The MIME type of the POST data sent to the server. |
| const char kProtoMimeType[] = "application/x-protobuf"; |
| @@ -56,12 +53,14 @@ const int kWorldReadableFilePermission = base::FILE_PERMISSION_READ_BY_USER | |
| base::FILE_PERMISSION_READ_BY_GROUP | |
| base::FILE_PERMISSION_READ_BY_OTHERS; |
| -// Returns the WebAPK server URL based on the command line flags and the |
| -// currently active field trials. |
| +// Returns the WebAPK server URL based on the command line. |
| GURL GetServerUrl() { |
| - GURL server_url(variations::GetVariationParamValueByFeature( |
| - chrome::android::kWebApks, kServerUrlVariationsParamKey)); |
| - return server_url.is_valid() ? server_url : GURL(kDefaultServerUrl); |
| + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| + std::string url_string = |
| + command_line->HasSwitch(switches::kWebApkServerUrl) |
| + ? command_line->GetSwitchValueASCII(switches::kWebApkServerUrl) |
| + : kDefaultServerUrl; |
| + return GURL(url_string); |
|
dominickn
2016/11/25 22:27:41
Should you check whether the GURL is valid here, i
|
| } |
| // Returns the scope from |info| if it is specified. Otherwise, returns the |