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

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

Issue 300843013: Install and launch kiosk app from cached crx file at start up. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
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/kiosk_app_manager.h" 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 const std::string& app_id, 349 const std::string& app_id,
350 Profile* profile, 350 Profile* profile,
351 const extensions::Extension* app) { 351 const extensions::Extension* app) {
352 KioskAppData* app_data = GetAppDataMutable(app_id); 352 KioskAppData* app_data = GetAppDataMutable(app_id);
353 if (!app_data) 353 if (!app_data)
354 return; 354 return;
355 355
356 app_data->LoadFromInstalledApp(profile, app); 356 app_data->LoadFromInstalledApp(profile, app);
357 } 357 }
358 358
359 bool KioskAppManager::GetCachedCrx(const std::string& app_id,
360 base::FilePath* file_path,
361 std::string* version) {
362 return external_cache_->GetExtension(app_id, file_path, version);
363 }
364
365 bool KioskAppManager::IsExtensionPendingForCache(const std::string& id) {
366 return external_cache_->IsExtensionPending(id);
367 }
368
369 bool KioskAppManager::IsExtensionPendingForUpdateCheck(const std::string& id) {
370 return external_cache_->IsExtensionPendingForUpdateCheck(id);
371 }
372
359 void KioskAppManager::AddObserver(KioskAppManagerObserver* observer) { 373 void KioskAppManager::AddObserver(KioskAppManagerObserver* observer) {
360 observers_.AddObserver(observer); 374 observers_.AddObserver(observer);
361 } 375 }
362 376
363 void KioskAppManager::RemoveObserver(KioskAppManagerObserver* observer) { 377 void KioskAppManager::RemoveObserver(KioskAppManagerObserver* observer) {
364 observers_.RemoveObserver(observer); 378 observers_.RemoveObserver(observer);
365 } 379 }
366 380
367 KioskAppManager::KioskAppManager() : ownership_established_(false) { 381 KioskAppManager::KioskAppManager() : ownership_established_(false) {
368 base::FilePath cache_dir; 382 base::FilePath cache_dir;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 dict_update->SetInteger(kKeyAutoLoginState, state); 543 dict_update->SetInteger(kKeyAutoLoginState, state);
530 prefs->CommitPendingWrite(); 544 prefs->CommitPendingWrite();
531 } 545 }
532 546
533 void KioskAppManager::GetCrxCacheDir(base::FilePath* cache_dir) { 547 void KioskAppManager::GetCrxCacheDir(base::FilePath* cache_dir) {
534 base::FilePath user_data_dir; 548 base::FilePath user_data_dir;
535 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)); 549 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir));
536 *cache_dir = user_data_dir.AppendASCII(kCrxCacheDir); 550 *cache_dir = user_data_dir.AppendASCII(kCrxCacheDir);
537 } 551 }
538 552
539 bool KioskAppManager::GetCachedCrx(const std::string& app_id,
540 base::FilePath* file_path,
541 std::string* version) {
542 return external_cache_->GetExtension(app_id, file_path, version);
543 }
544
545 } // namespace chromeos 553 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698