| 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/chromeos/app_mode/kiosk_app_data.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_data.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
| 13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
| 14 #include "base/prefs/scoped_user_pref_update.h" | 14 #include "base/prefs/scoped_user_pref_update.h" |
| 15 #include "base/threading/sequenced_worker_pool.h" | 15 #include "base/threading/sequenced_worker_pool.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/chromeos/app_mode/kiosk_app_data_delegate.h" | 18 #include "chrome/browser/chromeos/app_mode/kiosk_app_data_delegate.h" |
| 19 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 19 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 20 #include "chrome/browser/extensions/webstore_data_fetcher.h" | 20 #include "chrome/browser/extensions/webstore_data_fetcher.h" |
| 21 #include "chrome/browser/extensions/webstore_install_helper.h" | 21 #include "chrome/browser/extensions/webstore_install_helper.h" |
| 22 #include "chrome/browser/image_decoder.h" | 22 #include "chrome/browser/image_decoder.h" |
| 23 #include "chrome/common/extensions/extension_constants.h" | |
| 24 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
| 24 #include "extensions/common/extension_urls.h" |
| 25 #include "extensions/common/manifest.h" | 25 #include "extensions/common/manifest.h" |
| 26 #include "extensions/common/manifest_constants.h" | 26 #include "extensions/common/manifest_constants.h" |
| 27 #include "ui/gfx/codec/png_codec.h" | 27 #include "ui/gfx/codec/png_codec.h" |
| 28 | 28 |
| 29 using content::BrowserThread; | 29 using content::BrowserThread; |
| 30 | 30 |
| 31 namespace chromeos { | 31 namespace chromeos { |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 return; | 418 return; |
| 419 | 419 |
| 420 if (!CheckResponseKeyValue(webstore_data.get(), kLocalizedNameKey, &name_)) | 420 if (!CheckResponseKeyValue(webstore_data.get(), kLocalizedNameKey, &name_)) |
| 421 return; | 421 return; |
| 422 | 422 |
| 423 std::string icon_url_string; | 423 std::string icon_url_string; |
| 424 if (!CheckResponseKeyValue(webstore_data.get(), kIconUrlKey, | 424 if (!CheckResponseKeyValue(webstore_data.get(), kIconUrlKey, |
| 425 &icon_url_string)) | 425 &icon_url_string)) |
| 426 return; | 426 return; |
| 427 | 427 |
| 428 GURL icon_url = GURL(extension_urls::GetWebstoreLaunchURL()).Resolve( | 428 GURL icon_url = GURL(extensions::GetWebstoreLaunchURL()).Resolve( |
| 429 icon_url_string); | 429 icon_url_string); |
| 430 if (!icon_url.is_valid()) { | 430 if (!icon_url.is_valid()) { |
| 431 LOG(ERROR) << "Webstore response error (icon url): " | 431 LOG(ERROR) << "Webstore response error (icon url): " |
| 432 << ValueToString(webstore_data.get()); | 432 << ValueToString(webstore_data.get()); |
| 433 OnWebstoreResponseParseFailure(kInvalidWebstoreResponseError); | 433 OnWebstoreResponseParseFailure(kInvalidWebstoreResponseError); |
| 434 return; | 434 return; |
| 435 } | 435 } |
| 436 | 436 |
| 437 // WebstoreDataParser deletes itself when done. | 437 // WebstoreDataParser deletes itself when done. |
| 438 (new WebstoreDataParser(AsWeakPtr()))->Start(app_id_, | 438 (new WebstoreDataParser(AsWeakPtr()))->Start(app_id_, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 454 if (!response->GetString(key, value)) { | 454 if (!response->GetString(key, value)) { |
| 455 LOG(ERROR) << "Webstore response error (" << key | 455 LOG(ERROR) << "Webstore response error (" << key |
| 456 << "): " << ValueToString(response); | 456 << "): " << ValueToString(response); |
| 457 OnWebstoreResponseParseFailure(kInvalidWebstoreResponseError); | 457 OnWebstoreResponseParseFailure(kInvalidWebstoreResponseError); |
| 458 return false; | 458 return false; |
| 459 } | 459 } |
| 460 return true; | 460 return true; |
| 461 } | 461 } |
| 462 | 462 |
| 463 } // namespace chromeos | 463 } // namespace chromeos |
| OLD | NEW |