| 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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 using content::BrowserThread; | 35 using content::BrowserThread; |
| 36 | 36 |
| 37 namespace chromeos { | 37 namespace chromeos { |
| 38 | 38 |
| 39 namespace { | 39 namespace { |
| 40 | 40 |
| 41 // Keys for local state data. See sample layout in KioskAppManager. | 41 // Keys for local state data. See sample layout in KioskAppManager. |
| 42 const char kKeyName[] = "name"; | 42 const char kKeyName[] = "name"; |
| 43 const char kKeyIcon[] = "icon"; | 43 const char kKeyIcon[] = "icon"; |
| 44 | 44 |
| 45 // Web store data keys. | |
| 46 const char kManifestKey[] = "manifest"; | |
| 47 const char kIconUrlKey[] = "icon_url"; | |
| 48 const char kLocalizedNameKey[] = "localized_name"; | |
| 49 | |
| 50 const char kInvalidWebstoreResponseError[] = "Invalid Chrome Web Store reponse"; | 45 const char kInvalidWebstoreResponseError[] = "Invalid Chrome Web Store reponse"; |
| 51 | 46 |
| 52 // Icon file extension. | 47 // Icon file extension. |
| 53 const char kIconFileExtension[] = ".png"; | 48 const char kIconFileExtension[] = ".png"; |
| 54 | 49 |
| 55 // Save |raw_icon| for given |app_id|. | 50 // Save |raw_icon| for given |app_id|. |
| 56 void SaveIconToLocalOnBlockingPool( | 51 void SaveIconToLocalOnBlockingPool( |
| 57 const base::FilePath& icon_path, | 52 const base::FilePath& icon_path, |
| 58 scoped_refptr<base::RefCountedString> raw_icon) { | 53 scoped_refptr<base::RefCountedString> raw_icon) { |
| 59 DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); | 54 DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 if (!response->GetString(key, value)) { | 493 if (!response->GetString(key, value)) { |
| 499 LOG(ERROR) << "Webstore response error (" << key | 494 LOG(ERROR) << "Webstore response error (" << key |
| 500 << "): " << ValueToString(response); | 495 << "): " << ValueToString(response); |
| 501 OnWebstoreResponseParseFailure(kInvalidWebstoreResponseError); | 496 OnWebstoreResponseParseFailure(kInvalidWebstoreResponseError); |
| 502 return false; | 497 return false; |
| 503 } | 498 } |
| 504 return true; | 499 return true; |
| 505 } | 500 } |
| 506 | 501 |
| 507 } // namespace chromeos | 502 } // namespace chromeos |
| OLD | NEW |