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" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "base/version.h" | 14 #include "base/version.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/ui/kiosk_external_update_notification.h" | 16 #include "chrome/browser/chromeos/ui/kiosk_external_update_notification.h" |
17 #include "chrome/common/chrome_version_info.h" | 17 #include "components/version_info/version_info.h" |
18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
19 #include "extensions/browser/sandboxed_unpacker.h" | 19 #include "extensions/browser/sandboxed_unpacker.h" |
20 #include "extensions/common/extension.h" | 20 #include "extensions/common/extension.h" |
21 #include "grit/chromium_strings.h" | 21 #include "grit/chromium_strings.h" |
22 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
24 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
25 | 25 |
26 namespace chromeos { | 26 namespace chromeos { |
27 | 27 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if (!ShouldUpdateForHigherVersion(min_browser_version, |
388 if (!ShouldUpdateForHigherVersion( | 388 version_info::GetVersionNumber(), true)) { |
389 min_browser_version, current_version_info.Version(), true)) { | |
390 external_updates_[app_id].error = l10n_util::GetStringFUTF16( | 389 external_updates_[app_id].error = l10n_util::GetStringFUTF16( |
391 IDS_KIOSK_EXTERNAL_UPDATE_REQUIRE_HIGHER_BROWSER_VERSION, | 390 IDS_KIOSK_EXTERNAL_UPDATE_REQUIRE_HIGHER_BROWSER_VERSION, |
392 base::UTF8ToUTF16(min_browser_version)); | 391 base::UTF8ToUTF16(min_browser_version)); |
393 return false; | 392 return false; |
394 } | 393 } |
395 } | 394 } |
396 | 395 |
397 return true; | 396 return true; |
398 } | 397 } |
399 | 398 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 if (failed) { | 524 if (failed) { |
526 failed_app_msg = ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | 525 failed_app_msg = ui::ResourceBundle::GetSharedInstance().GetLocalizedString( |
527 IDS_KIOSK_EXTERNAL_UPDATE_FAILED_UPDATED_APPS) + | 526 IDS_KIOSK_EXTERNAL_UPDATE_FAILED_UPDATED_APPS) + |
528 base::ASCIIToUTF16("\n") + failed_apps; | 527 base::ASCIIToUTF16("\n") + failed_apps; |
529 message = message + base::ASCIIToUTF16("\n") + failed_app_msg; | 528 message = message + base::ASCIIToUTF16("\n") + failed_app_msg; |
530 } | 529 } |
531 return message; | 530 return message; |
532 } | 531 } |
533 | 532 |
534 } // namespace chromeos | 533 } // namespace chromeos |
OLD | NEW |