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

Side by Side Diff: chrome/browser/chromeos/app_mode/startup_app_launcher.cc

Issue 23604068: Add "kiosk_only" manifest attribute for platform apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed .crx binary Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/login/fake_user_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" 5 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/json/json_file_value_serializer.h" 9 #include "base/json/json_file_value_serializer.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
14 #include "chrome/browser/chromeos/app_mode/app_session_lifetime.h" 14 #include "chrome/browser/chromeos/app_mode/app_session_lifetime.h"
15 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 15 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
16 #include "chrome/browser/chromeos/login/user_manager.h" 16 #include "chrome/browser/chromeos/login/user_manager.h"
17 #include "chrome/browser/extensions/extension_service.h" 17 #include "chrome/browser/extensions/extension_service.h"
18 #include "chrome/browser/extensions/extension_system.h" 18 #include "chrome/browser/extensions/extension_system.h"
19 #include "chrome/browser/extensions/webstore_startup_installer.h" 19 #include "chrome/browser/extensions/webstore_startup_installer.h"
20 #include "chrome/browser/lifetime/application_lifetime.h" 20 #include "chrome/browser/lifetime/application_lifetime.h"
21 #include "chrome/browser/signin/profile_oauth2_token_service.h" 21 #include "chrome/browser/signin/profile_oauth2_token_service.h"
22 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 22 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
23 #include "chrome/browser/signin/token_service.h" 23 #include "chrome/browser/signin/token_service.h"
24 #include "chrome/browser/signin/token_service_factory.h" 24 #include "chrome/browser/signin/token_service_factory.h"
25 #include "chrome/browser/ui/extensions/application_launch.h" 25 #include "chrome/browser/ui/extensions/application_launch.h"
26 #include "chrome/common/chrome_paths.h" 26 #include "chrome/common/chrome_paths.h"
27 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
28 #include "chrome/common/extensions/extension.h" 28 #include "chrome/common/extensions/extension.h"
29 #include "chrome/common/extensions/manifest_handlers/kiosk_enabled_info.h" 29 #include "chrome/common/extensions/manifest_handlers/kiosk_mode_info.h"
30 #include "content/public/browser/browser_thread.h" 30 #include "content/public/browser/browser_thread.h"
31 #include "content/public/browser/notification_service.h" 31 #include "content/public/browser/notification_service.h"
32 #include "google_apis/gaia/gaia_auth_consumer.h" 32 #include "google_apis/gaia/gaia_auth_consumer.h"
33 #include "google_apis/gaia/gaia_constants.h" 33 #include "google_apis/gaia/gaia_constants.h"
34 34
35 using content::BrowserThread; 35 using content::BrowserThread;
36 using extensions::Extension; 36 using extensions::Extension;
37 using extensions::WebstoreStartupInstaller; 37 using extensions::WebstoreStartupInstaller;
38 38
39 namespace chromeos { 39 namespace chromeos {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 void StartupAppLauncher::LaunchApp() { 215 void StartupAppLauncher::LaunchApp() {
216 if (!ready_to_launch_) { 216 if (!ready_to_launch_) {
217 NOTREACHED(); 217 NOTREACHED();
218 LOG(ERROR) << "LaunchApp() called but launcher is not initialized."; 218 LOG(ERROR) << "LaunchApp() called but launcher is not initialized.";
219 } 219 }
220 220
221 const Extension* extension = extensions::ExtensionSystem::Get(profile_)-> 221 const Extension* extension = extensions::ExtensionSystem::Get(profile_)->
222 extension_service()->GetInstalledExtension(app_id_); 222 extension_service()->GetInstalledExtension(app_id_);
223 CHECK(extension); 223 CHECK(extension);
224 224
225 if (!extensions::KioskEnabledInfo::IsKioskEnabled(extension)) { 225 if (!extensions::KioskModeInfo::IsKioskEnabled(extension)) {
226 OnLaunchFailure(KioskAppLaunchError::NOT_KIOSK_ENABLED); 226 OnLaunchFailure(KioskAppLaunchError::NOT_KIOSK_ENABLED);
227 return; 227 return;
228 } 228 }
229 229
230 // Always open the app in a window. 230 // Always open the app in a window.
231 chrome::OpenApplication(chrome::AppLaunchParams(profile_, 231 chrome::OpenApplication(chrome::AppLaunchParams(profile_,
232 extension, 232 extension,
233 extension_misc::LAUNCH_WINDOW, 233 extension_misc::LAUNCH_WINDOW,
234 NEW_WINDOW)); 234 NEW_WINDOW));
235 InitAppSession(profile_, app_id_); 235 InitAppSession(profile_, app_id_);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 DVLOG(1) << "Network up and running!"; 294 DVLOG(1) << "Network up and running!";
295 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this); 295 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
296 296
297 BeginInstall(); 297 BeginInstall();
298 } else { 298 } else {
299 DVLOG(1) << "Network not running yet!"; 299 DVLOG(1) << "Network not running yet!";
300 } 300 }
301 } 301 }
302 302
303 } // namespace chromeos 303 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/login/fake_user_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698