diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-12-08 10:22:59 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-12-08 12:17:14 +0000 |
commit | 69b8f9169ffd66fdeca1ac60a4bc06b91d106186 (patch) | |
tree | c8b7f735583d0b4e0c0b61a014a7f4b3b26e85ab /chromium/chrome/browser/ui | |
parent | daa093eea7c773db06799a13bd7e4e2e2a9f8f14 (diff) | |
download | qtwebengine-chromium-69b8f9169ffd66fdeca1ac60a4bc06b91d106186.tar.gz |
BASELINE: Update Chromium to 63.0.3239.87
Change-Id: Iac27464730121b4fac76869d87d622504642e016
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/chrome/browser/ui')
-rw-r--r-- | chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc | 41 | ||||
-rw-r--r-- | chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h | 8 |
2 files changed, 35 insertions, 14 deletions
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc index 712663b8457..365c68203b1 100644 --- a/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc +++ b/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc @@ -12,6 +12,7 @@ #include "base/metrics/histogram_macros.h" #include "base/stl_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/sys_info.h" #include "base/task_scheduler/post_task.h" #include "base/values.h" #include "chrome/browser/browser_process.h" @@ -35,6 +36,7 @@ #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" +#include "chrome/installer/util/google_update_settings.h" #include "chromeos/chromeos_switches.h" #include "chromeos/login/auth/authpolicy_login_helper.h" #include "chromeos/login/auth/user_context.h" @@ -212,6 +214,11 @@ bool IsOnline(NetworkPortalDetector::CaptivePortalStatus status) { return status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; } +void GetVersionAndConsent(std::string* out_version, bool* out_consent) { + *out_version = version_loader::GetVersion(version_loader::VERSION_SHORT); + *out_consent = GoogleUpdateSettings::GetCollectStatsConsent(); +} + } // namespace // A class that's used to specify the way how Gaia should be loaded. @@ -289,16 +296,24 @@ void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { } void GaiaScreenHandler::LoadGaia(const GaiaContext& context) { - base::PostTaskWithTraitsAndReplyWithResult( - FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, - base::Bind(&version_loader::GetVersion, version_loader::VERSION_SHORT), - base::Bind(&GaiaScreenHandler::LoadGaiaWithVersion, - weak_factory_.GetWeakPtr(), context)); -} - -void GaiaScreenHandler::LoadGaiaWithVersion( + std::unique_ptr<std::string> version = std::make_unique<std::string>(); + std::unique_ptr<bool> consent = std::make_unique<bool>(); + base::OnceClosure get_version_and_consent = + base::BindOnce(&GetVersionAndConsent, base::Unretained(version.get()), + base::Unretained(consent.get())); + base::OnceClosure load_gaia = base::BindOnce( + &GaiaScreenHandler::LoadGaiaWithVersionAndConsent, + weak_factory_.GetWeakPtr(), context, base::Owned(version.release()), + base::Owned(consent.release())); + base::PostTaskWithTraitsAndReply( + FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, + std::move(get_version_and_consent), std::move(load_gaia)); +} + +void GaiaScreenHandler::LoadGaiaWithVersionAndConsent( const GaiaContext& context, - const std::string& platform_version) { + const std::string* platform_version, + const bool* collect_stats_consent) { base::DictionaryValue params; params.SetBoolean("forceReload", context.force_reload); @@ -348,8 +363,8 @@ void GaiaScreenHandler::LoadGaiaWithVersion( params.SetString("clientId", GaiaUrls::GetInstance()->oauth2_chrome_client_id()); params.SetString("clientVersion", version_info::GetVersionNumber()); - if (!platform_version.empty()) - params.SetString("platformVersion", platform_version); + if (!platform_version->empty()) + params.SetString("platformVersion", *platform_version); params.SetString("releaseChannel", chrome::GetChannelString()); params.SetString("endpointGen", kEndpointGen); @@ -370,6 +385,10 @@ void GaiaScreenHandler::LoadGaiaWithVersion( // (see https://crbug.com/709244 ). params.SetString("chromeOSApiVersion", "2"); } + // We only send |chromeos_board| Gaia URL parameter if user has opted into + // sending device statistics. + if (*collect_stats_consent) + params.SetString("lsbReleaseBoard", base::SysInfo::GetLsbReleaseBoard()); frame_state_ = FRAME_STATE_LOADING; CallJS("loadAuthExtension", params); diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h index 2cda506da93..5ef51ba2f57 100644 --- a/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h +++ b/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h @@ -58,9 +58,11 @@ class GaiaScreenHandler : public BaseScreenHandler, void LoadGaia(const GaiaContext& context); - // Callback that loads GAIA after version information has been retrieved. - void LoadGaiaWithVersion(const GaiaContext& context, - const std::string& platform_version); + // Callback that loads GAIA after version and stat consent information has + // been retrieved. + void LoadGaiaWithVersionAndConsent(const GaiaContext& context, + const std::string* platform_version, + const bool* collect_stats_consent); // Sends request to reload Gaia. If |force_reload| is true, request // will be sent in any case, otherwise it will be sent only when Gaia is |