| OLD | NEW |
| 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/ui/webui/chromeos/login/kiosk_app_menu_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 if (!is_webui_initialized_) | 94 if (!is_webui_initialized_) |
| 95 return; | 95 return; |
| 96 | 96 |
| 97 KioskAppManager::Apps apps; | 97 KioskAppManager::Apps apps; |
| 98 KioskAppManager::Get()->GetApps(&apps); | 98 KioskAppManager::Get()->GetApps(&apps); |
| 99 | 99 |
| 100 base::ListValue apps_list; | 100 base::ListValue apps_list; |
| 101 for (size_t i = 0; i < apps.size(); ++i) { | 101 for (size_t i = 0; i < apps.size(); ++i) { |
| 102 const KioskAppManager::App& app_data = apps[i]; | 102 const KioskAppManager::App& app_data = apps[i]; |
| 103 | 103 |
| 104 scoped_ptr<base::DictionaryValue> app_info(new base::DictionaryValue); | 104 std::unique_ptr<base::DictionaryValue> app_info(new base::DictionaryValue); |
| 105 app_info->SetBoolean("isApp", true); | 105 app_info->SetBoolean("isApp", true); |
| 106 app_info->SetString("id", app_data.app_id); | 106 app_info->SetString("id", app_data.app_id); |
| 107 app_info->SetString("label", app_data.name); | 107 app_info->SetString("label", app_data.name); |
| 108 | 108 |
| 109 std::string icon_url; | 109 std::string icon_url; |
| 110 if (app_data.icon.isNull()) { | 110 if (app_data.icon.isNull()) { |
| 111 icon_url = | 111 icon_url = |
| 112 webui::GetBitmapDataUrl(*ResourceBundle::GetSharedInstance() | 112 webui::GetBitmapDataUrl(*ResourceBundle::GetSharedInstance() |
| 113 .GetImageNamed(IDR_APP_DEFAULT_ICON) | 113 .GetImageNamed(IDR_APP_DEFAULT_ICON) |
| 114 .ToSkBitmap()); | 114 .ToSkBitmap()); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 void KioskAppMenuHandler::OnKioskAppDataLoadFailure(const std::string& app_id) { | 165 void KioskAppMenuHandler::OnKioskAppDataLoadFailure(const std::string& app_id) { |
| 166 SendKioskApps(); | 166 SendKioskApps(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void KioskAppMenuHandler::UpdateState(NetworkError::ErrorReason reason) { | 169 void KioskAppMenuHandler::UpdateState(NetworkError::ErrorReason reason) { |
| 170 if (network_state_informer_->state() == NetworkStateInformer::ONLINE) | 170 if (network_state_informer_->state() == NetworkStateInformer::ONLINE) |
| 171 KioskAppManager::Get()->RetryFailedAppDataFetch(); | 171 KioskAppManager::Get()->RetryFailedAppDataFetch(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace chromeos | 174 } // namespace chromeos |
| OLD | NEW |