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..c9a2e73becb914784d77e469a7745d336708fdeb 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" |
| @@ -22,6 +23,7 @@ |
| #include "chrome/browser/android/webapk/webapk.pb.h" |
| #include "chrome/browser/android/webapk/webapk_icon_hasher.h" |
| #include "chrome/browser/profiles/profile.h" |
| +#include "chrome/common/chrome_switches.h" |
| #include "components/variations/variations_associated_data.h" |
|
Xi Han
2016/11/24 14:27:50
Do you still need this include? I see you removed
|
| #include "components/version_info/version_info.h" |
| #include "content/public/browser/browser_thread.h" |
| @@ -36,10 +38,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"; |
|
Xi Han
2016/11/24 14:27:50
Is the test server public? I am wondering whether
pkotwicz
2016/11/25 01:29:19
A user can currently figure out what the URL is us
|
| // The MIME type of the POST data sent to the server. |
| const char kProtoMimeType[] = "application/x-protobuf"; |
| @@ -56,12 +55,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); |
| } |
| // Returns the scope from |info| if it is specified. Otherwise, returns the |