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/common/web_apps.h" | 5 #include "chrome/common/web_apps.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 icon_sizes.size() != 1) { | 78 icon_sizes.size() != 1) { |
79 return; | 79 return; |
80 } | 80 } |
81 WebApplicationInfo::IconInfo icon_info; | 81 WebApplicationInfo::IconInfo icon_info; |
82 icon_info.width = icon_sizes[0].width(); | 82 icon_info.width = icon_sizes[0].width(); |
83 icon_info.height = icon_sizes[0].height(); | 83 icon_info.height = icon_sizes[0].height(); |
84 icon_info.url = url; | 84 icon_info.url = url; |
85 icons->push_back(icon_info); | 85 icons->push_back(icon_info); |
86 } | 86 } |
87 | 87 |
88 } | 88 } // namespace |
89 | 89 |
90 const char WebApplicationInfo::kInvalidDefinitionURL[] = | 90 const char WebApplicationInfo::kInvalidDefinitionURL[] = |
91 "Invalid application definition URL. Must be a valid relative URL or " | 91 "Invalid application definition URL. Must be a valid relative URL or " |
92 "an absolute URL with the same origin as the document."; | 92 "an absolute URL with the same origin as the document."; |
93 const char WebApplicationInfo::kInvalidLaunchURL[] = | 93 const char WebApplicationInfo::kInvalidLaunchURL[] = |
94 "Invalid value for property 'launch_url'. Must be a valid relative URL or " | 94 "Invalid value for property 'launch_url'. Must be a valid relative URL or " |
95 "an absolute URL with the same origin as the application definition."; | 95 "an absolute URL with the same origin as the application definition."; |
96 const char WebApplicationInfo::kInvalidURL[] = | 96 const char WebApplicationInfo::kInvalidURL[] = |
97 "Invalid value for property 'urls[*]'. Must be a valid relative URL or " | 97 "Invalid value for property 'urls[*]'. Must be a valid relative URL or " |
98 "an absolute URL with the same origin as the application definition."; | 98 "an absolute URL with the same origin as the application definition."; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 320 |
321 CHECK(definition->GetString("name", &web_app->title)); | 321 CHECK(definition->GetString("name", &web_app->title)); |
322 definition->GetString("description", &web_app->description); | 322 definition->GetString("description", &web_app->description); |
323 definition->GetString("launch_container", &web_app->launch_container); | 323 definition->GetString("launch_container", &web_app->launch_container); |
324 web_app->app_url = app_url; | 324 web_app->app_url = app_url; |
325 web_app->urls = urls; | 325 web_app->urls = urls; |
326 web_app->permissions = permissions; | 326 web_app->permissions = permissions; |
327 web_app->icons = icons; | 327 web_app->icons = icons; |
328 | 328 |
329 return true; | 329 return true; |
330 | |
331 } | 330 } |
332 | 331 |
333 } // namespace web_apps | 332 } // namespace web_apps |
OLD | NEW |