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 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ |
6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ | 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 | 60 |
61 // Clears locally cached data. | 61 // Clears locally cached data. |
62 void ClearCache(); | 62 void ClearCache(); |
63 | 63 |
64 // Loads app data from the app installed in the given profile. | 64 // Loads app data from the app installed in the given profile. |
65 void LoadFromInstalledApp(Profile* profile, const extensions::Extension* app); | 65 void LoadFromInstalledApp(Profile* profile, const extensions::Extension* app); |
66 | 66 |
67 // Returns true if web store data fetching is in progress. | 67 // Returns true if web store data fetching is in progress. |
68 bool IsLoading() const; | 68 bool IsLoading() const; |
69 | 69 |
70 // Returns true if the crx file is going to be downloaded in cache. | |
71 bool IsCrxCacheLoading() const; | |
xiyuan
2014/05/02 03:22:12
This probably should better be part of ExternalCac
jennyz
2014/05/02 17:46:55
Done.
| |
72 | |
70 const std::string& app_id() const { return app_id_; } | 73 const std::string& app_id() const { return app_id_; } |
71 const std::string& user_id() const { return user_id_; } | 74 const std::string& user_id() const { return user_id_; } |
72 const std::string& name() const { return name_; } | 75 const std::string& name() const { return name_; } |
73 const gfx::ImageSkia& icon() const { return icon_; } | 76 const gfx::ImageSkia& icon() const { return icon_; } |
74 const base::RefCountedString* raw_icon() const { | 77 const base::RefCountedString* raw_icon() const { |
75 return raw_icon_.get(); | 78 return raw_icon_.get(); |
76 } | 79 } |
77 Status status() const { return status_; } | 80 Status status() const { return status_; } |
81 void SetCrxCacheStatus(Status crx_cache_status); | |
78 | 82 |
79 private: | 83 private: |
80 class IconLoader; | 84 class IconLoader; |
81 class WebstoreDataParser; | 85 class WebstoreDataParser; |
82 | 86 |
83 void SetStatus(Status status); | 87 void SetStatus(Status status); |
84 | 88 |
85 // Returns URLRequestContextGetter to use for fetching web store data. | 89 // Returns URLRequestContextGetter to use for fetching web store data. |
86 net::URLRequestContextGetter* GetRequestContextGetter(); | 90 net::URLRequestContextGetter* GetRequestContextGetter(); |
87 | 91 |
(...skipping 30 matching lines...) Expand all Loading... | |
118 | 122 |
119 // Helper function for testing for the existence of |key| in | 123 // Helper function for testing for the existence of |key| in |
120 // |response|. Passes |key|'s content via |value| and returns | 124 // |response|. Passes |key|'s content via |value| and returns |
121 // true when |key| is present. | 125 // true when |key| is present. |
122 bool CheckResponseKeyValue(const base::DictionaryValue* response, | 126 bool CheckResponseKeyValue(const base::DictionaryValue* response, |
123 const char* key, | 127 const char* key, |
124 std::string* value); | 128 std::string* value); |
125 | 129 |
126 KioskAppDataDelegate* delegate_; // not owned. | 130 KioskAppDataDelegate* delegate_; // not owned. |
127 Status status_; | 131 Status status_; |
132 Status crx_cache_status_; | |
128 | 133 |
129 std::string app_id_; | 134 std::string app_id_; |
130 std::string user_id_; | 135 std::string user_id_; |
131 std::string name_; | 136 std::string name_; |
132 gfx::ImageSkia icon_; | 137 gfx::ImageSkia icon_; |
133 scoped_refptr<base::RefCountedString> raw_icon_; | 138 scoped_refptr<base::RefCountedString> raw_icon_; |
134 | 139 |
135 scoped_ptr<extensions::WebstoreDataFetcher> webstore_fetcher_; | 140 scoped_ptr<extensions::WebstoreDataFetcher> webstore_fetcher_; |
136 base::FilePath icon_path_; | 141 base::FilePath icon_path_; |
137 | 142 |
138 DISALLOW_COPY_AND_ASSIGN(KioskAppData); | 143 DISALLOW_COPY_AND_ASSIGN(KioskAppData); |
139 }; | 144 }; |
140 | 145 |
141 } // namespace chromeos | 146 } // namespace chromeos |
142 | 147 |
143 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ | 148 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ |
OLD | NEW |