OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_external_updater.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_external_updater.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 const std::string& min_browser_version) { | 368 const std::string& min_browser_version) { |
369 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 369 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
370 | 370 |
371 std::string existing_version_str; | 371 std::string existing_version_str; |
372 base::FilePath existing_path; | 372 base::FilePath existing_path; |
373 bool cached = KioskAppManager::Get()->GetCachedCrx( | 373 bool cached = KioskAppManager::Get()->GetCachedCrx( |
374 app_id, &existing_path, &existing_version_str); | 374 app_id, &existing_path, &existing_version_str); |
375 DCHECK(cached); | 375 DCHECK(cached); |
376 | 376 |
377 // Compare app version. | 377 // Compare app version. |
378 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 378 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
379 if (!ShouldUpdateForHigherVersion(existing_version_str, version, false)) { | 379 if (!ShouldUpdateForHigherVersion(existing_version_str, version, false)) { |
380 external_updates_[app_id].error = rb.GetLocalizedString( | 380 external_updates_[app_id].error = rb->GetLocalizedString( |
381 IDS_KIOSK_EXTERNAL_UPDATE_SAME_OR_LOWER_APP_VERSION); | 381 IDS_KIOSK_EXTERNAL_UPDATE_SAME_OR_LOWER_APP_VERSION); |
382 return false; | 382 return false; |
383 } | 383 } |
384 | 384 |
385 // Check minimum browser version. | 385 // Check minimum browser version. |
386 if (!min_browser_version.empty()) { | 386 if (!min_browser_version.empty()) { |
387 chrome::VersionInfo current_version_info; | 387 chrome::VersionInfo current_version_info; |
388 if (!ShouldUpdateForHigherVersion( | 388 if (!ShouldUpdateForHigherVersion( |
389 min_browser_version, current_version_info.Version(), true)) { | 389 min_browser_version, current_version_info.Version(), true)) { |
390 external_updates_[app_id].error = l10n_util::GetStringFUTF16( | 390 external_updates_[app_id].error = l10n_util::GetStringFUTF16( |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 if (failed) { | 525 if (failed) { |
526 failed_app_msg = ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | 526 failed_app_msg = ui::ResourceBundle::GetSharedInstance().GetLocalizedString( |
527 IDS_KIOSK_EXTERNAL_UPDATE_FAILED_UPDATED_APPS) + | 527 IDS_KIOSK_EXTERNAL_UPDATE_FAILED_UPDATED_APPS) + |
528 base::ASCIIToUTF16("\n") + failed_apps; | 528 base::ASCIIToUTF16("\n") + failed_apps; |
529 message = message + base::ASCIIToUTF16("\n") + failed_app_msg; | 529 message = message + base::ASCIIToUTF16("\n") + failed_app_msg; |
530 } | 530 } |
531 return message; | 531 return message; |
532 } | 532 } |
533 | 533 |
534 } // namespace chromeos | 534 } // namespace chromeos |
OLD | NEW |