| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/drive_internals_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/drive_internals_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 LOG(ERROR) << "Failed to get app list"; | 346 LOG(ERROR) << "Failed to get app list"; |
| 347 return; | 347 return; |
| 348 } | 348 } |
| 349 DCHECK(parsed_app_list); | 349 DCHECK(parsed_app_list); |
| 350 | 350 |
| 351 base::DictionaryValue app_list; | 351 base::DictionaryValue app_list; |
| 352 app_list.SetString("etag", parsed_app_list->etag()); | 352 app_list.SetString("etag", parsed_app_list->etag()); |
| 353 | 353 |
| 354 base::ListValue* items = new base::ListValue(); | 354 base::ListValue* items = new base::ListValue(); |
| 355 for (size_t i = 0; i < parsed_app_list->items().size(); ++i) { | 355 for (size_t i = 0; i < parsed_app_list->items().size(); ++i) { |
| 356 const google_apis::AppResource* app = parsed_app_list->items()[i]; | 356 const google_apis::AppResource* app = parsed_app_list->items()[i].get(); |
| 357 auto app_data = base::MakeUnique<base::DictionaryValue>(); | 357 auto app_data = base::MakeUnique<base::DictionaryValue>(); |
| 358 app_data->SetString("name", app->name()); | 358 app_data->SetString("name", app->name()); |
| 359 app_data->SetString("application_id", app->application_id()); | 359 app_data->SetString("application_id", app->application_id()); |
| 360 app_data->SetString("object_type", app->object_type()); | 360 app_data->SetString("object_type", app->object_type()); |
| 361 app_data->SetBoolean("supports_create", app->supports_create()); | 361 app_data->SetBoolean("supports_create", app->supports_create()); |
| 362 | 362 |
| 363 items->Append(std::move(app_data)); | 363 items->Append(std::move(app_data)); |
| 364 } | 364 } |
| 365 app_list.Set("items", items); | 365 app_list.Set("items", items); |
| 366 | 366 |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); | 899 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); |
| 900 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 900 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
| 901 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 901 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
| 902 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); | 902 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); |
| 903 | 903 |
| 904 Profile* profile = Profile::FromWebUI(web_ui); | 904 Profile* profile = Profile::FromWebUI(web_ui); |
| 905 content::WebUIDataSource::Add(profile, source); | 905 content::WebUIDataSource::Add(profile, source); |
| 906 } | 906 } |
| 907 | 907 |
| 908 } // namespace chromeos | 908 } // namespace chromeos |
| OLD | NEW |