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/chromeos/drive/drive_webapps_registry.h" | 5 #include "chrome/browser/chromeos/drive/drive_webapps_registry.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 if (product_url.is_empty()) | 159 if (product_url.is_empty()) |
160 continue; | 160 continue; |
161 | 161 |
162 gdata::InstalledApp::IconList app_icons = | 162 gdata::InstalledApp::IconList app_icons = |
163 app.GetIconsForCategory(gdata::AppIcon::ICON_APPLICATION); | 163 app.GetIconsForCategory(gdata::AppIcon::ICON_APPLICATION); |
164 gdata::InstalledApp::IconList document_icons = | 164 gdata::InstalledApp::IconList document_icons = |
165 app.GetIconsForCategory(gdata::AppIcon::ICON_DOCUMENT); | 165 app.GetIconsForCategory(gdata::AppIcon::ICON_DOCUMENT); |
166 | 166 |
167 if (VLOG_IS_ON(1)) { | 167 if (VLOG_IS_ON(1)) { |
168 std::vector<std::string> mime_types; | 168 std::vector<std::string> mime_types; |
169 for (size_t i = 0; app.primary_mimetypes().size(); ++i) | 169 for (size_t i = 0; i < app.primary_mimetypes().size(); ++i) |
170 mime_types.push_back(*app.primary_mimetypes()[i]); | 170 mime_types.push_back(*app.primary_mimetypes()[i]); |
171 for (size_t i = 0; app.secondary_mimetypes().size(); ++i) | 171 for (size_t i = 0; i < app.secondary_mimetypes().size(); ++i) |
172 mime_types.push_back(*app.secondary_mimetypes()[i]); | 172 mime_types.push_back(*app.secondary_mimetypes()[i]); |
173 | |
174 std::vector<std::string> extensions; | 173 std::vector<std::string> extensions; |
175 for (size_t i = 0; app.primary_extensions().size(); ++i) | 174 for (size_t i = 0; i < app.primary_extensions().size(); ++i) |
176 extensions.push_back(*app.primary_extensions()[i]); | 175 extensions.push_back(*app.primary_extensions()[i]); |
177 for (size_t i = 0; app.secondary_extensions().size(); ++i) | 176 for (size_t i = 0; i < app.secondary_extensions().size(); ++i) |
178 extensions.push_back(*app.secondary_extensions()[i]); | 177 extensions.push_back(*app.secondary_extensions()[i]); |
179 | |
180 VLOG(1) << "Adding app " << app.app_name() | 178 VLOG(1) << "Adding app " << app.app_name() |
181 << " to app registry. mime_types: " | 179 << " to app registry. mime_types: " |
182 << JoinString(mime_types, ',') << " extensions: " | 180 << JoinString(mime_types, ',') << " extensions: " |
183 << JoinString(extensions, ','); | 181 << JoinString(extensions, ','); |
184 } | 182 } |
185 | 183 |
186 url_to_name_map_.insert( | 184 url_to_name_map_.insert( |
187 std::make_pair(product_url, app.app_name())); | 185 std::make_pair(product_url, app.app_name())); |
188 AddAppSelectorList(product_url, | 186 AddAppSelectorList(product_url, |
189 app_icons, | 187 app_icons, |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 web_app->app_icons, | 333 web_app->app_icons, |
336 web_app->document_icons, | 334 web_app->document_icons, |
337 web_store_id, | 335 web_store_id, |
338 product_iter->second, // app name. | 336 product_iter->second, // app name. |
339 web_app->object_type, | 337 web_app->object_type, |
340 web_app->is_primary_selector))); | 338 web_app->is_primary_selector))); |
341 } | 339 } |
342 } | 340 } |
343 | 341 |
344 } // namespace drive | 342 } // namespace drive |
OLD | NEW |