Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: chrome/browser/chromeos/app_mode/startup_app_launcher.cc

Issue 79113002: kiosk: Network connectivity test during launch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: hide spacer for non-kiosk error Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/app_mode/startup_app_launcher.cc
diff --git a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
index 68021df80237260035e31e375bbc7ad01056c94e..f71a5f5729a757f2be5f440eab2e38485088c34c 100644
--- a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
+++ b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
@@ -57,6 +57,7 @@ StartupAppLauncher::StartupAppLauncher(Profile* profile,
const std::string& app_id)
: profile_(profile),
app_id_(app_id),
+ install_attempted_(false),
ready_to_launch_(false) {
DCHECK(profile_);
DCHECK(Extension::IdIsValid(app_id_));
@@ -67,15 +68,20 @@ StartupAppLauncher::~StartupAppLauncher() {
// through a user bailout shortcut.
ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)
->RemoveObserver(this);
- net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
}
void StartupAppLauncher::Initialize() {
- DVLOG(1) << "Starting... connection = "
- << net::NetworkChangeNotifier::GetConnectionType();
StartLoadingOAuthFile();
}
+void StartupAppLauncher::ContinueWithNetworkReady() {
+ // Starts install if it is not started.
+ if (!install_attempted_) {
+ install_attempted_ = true;
+ BeginInstall();
+ }
+}
+
void StartupAppLauncher::AddObserver(Observer* observer) {
observer_list_.AddObserver(observer);
}
@@ -138,12 +144,6 @@ void StartupAppLauncher::OnOAuthFileLoaded(KioskOAuthParams* auth_params) {
void StartupAppLauncher::InitializeNetwork() {
FOR_EACH_OBSERVER(Observer, observer_list_, OnInitializingNetwork());
-
- // TODO(tengs): Use NetworkStateInformer instead because it can handle
- // portal and proxy detection. We will need to do some refactoring to
- // make NetworkStateInformer more independent from the WebUI handlers.
- net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
- OnNetworkChanged(net::NetworkChangeNotifier::GetConnectionType());
}
void StartupAppLauncher::InitializeTokenService() {
@@ -233,9 +233,6 @@ void StartupAppLauncher::LaunchApp() {
void StartupAppLauncher::BeginInstall() {
FOR_EACH_OBSERVER(Observer, observer_list_, OnInstallingApp());
- DVLOG(1) << "BeginInstall... connection = "
- << net::NetworkChangeNotifier::GetConnectionType();
-
if (IsAppInstalled(profile_, app_id_)) {
OnReadyToLaunch();
return;
@@ -272,18 +269,4 @@ void StartupAppLauncher::OnReadyToLaunch() {
FOR_EACH_OBSERVER(Observer, observer_list_, OnReadyToLaunch());
}
-void StartupAppLauncher::OnNetworkChanged(
- net::NetworkChangeNotifier::ConnectionType type) {
- DVLOG(1) << "OnNetworkChanged... connection = "
- << net::NetworkChangeNotifier::GetConnectionType();
- if (!net::NetworkChangeNotifier::IsOffline()) {
- DVLOG(1) << "Network up and running!";
- net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
-
- BeginInstall();
- } else {
- DVLOG(1) << "Network not running yet!";
- }
-}
-
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698