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

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

Issue 181233007: kiosk: Fix network check skipped regression. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months 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 e69c3be9b24689d69114d9982e419c3ae669bd60..fe4e1af6192d0b7fed7cd43176c5021d5d107c20 100644
--- a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
+++ b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
@@ -32,6 +32,7 @@
#include "content/public/browser/notification_service.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
+#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/kiosk_mode_info.h"
#include "extensions/common/manifest_handlers/offline_enabled_info.h"
#include "google_apis/gaia/gaia_auth_consumer.h"
@@ -148,7 +149,14 @@ void StartupAppLauncher::OnOAuthFileLoaded(KioskOAuthParams* auth_params) {
void StartupAppLauncher::MaybeInitializeNetwork() {
const Extension* extension = extensions::ExtensionSystem::Get(profile_)->
extension_service()->GetInstalledExtension(app_id_);
+ // Kiosk apps are platform apps and platform apps default to be
+ // offline enabled if "offline_enabled" key is not provided. However,
+ // network check should be performed in that case. The only case the check
+ // should be skipped is the kiosk app explicitly declares "offline_enabled"
+ // true in its manifest.
miket_OOO 2014/03/05 18:32:22 Is this a good idea? It's giving a lot of subtlety
xiyuan 2014/03/05 18:44:18 Agree that having a new key would be more straight
const bool requires_network = !extension ||
+ !extension->manifest()->HasKey(
+ extensions::manifest_keys::kOfflineEnabled) ||
!extensions::OfflineEnabledInfo::IsOfflineEnabled(extension);
if (requires_network) {
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/kiosk_browsertest.cc » ('j') | chrome/browser/chromeos/login/kiosk_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698