Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: chrome/common/web_apps.cc

Issue 10704092: Add offline_mode support in crxless apps (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/web_apps.h ('k') | chrome/common/web_apps_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 "an absolute URL with the same origin as the application definition."; 96 "an absolute URL with the same origin as the application definition.";
97 const char WebApplicationInfo::kInvalidURL[] = 97 const char WebApplicationInfo::kInvalidURL[] =
98 "Invalid value for property 'urls[*]'. Must be a valid relative URL or " 98 "Invalid value for property 'urls[*]'. Must be a valid relative URL or "
99 "an absolute URL with the same origin as the application definition."; 99 "an absolute URL with the same origin as the application definition.";
100 const char WebApplicationInfo::kInvalidIconURL[] = 100 const char WebApplicationInfo::kInvalidIconURL[] =
101 "Invalid value for property 'icons.*'. Must be a valid relative URL or " 101 "Invalid value for property 'icons.*'. Must be a valid relative URL or "
102 "an absolute URL with the same origin as the application definition."; 102 "an absolute URL with the same origin as the application definition.";
103 103
104 WebApplicationInfo::WebApplicationInfo() { 104 WebApplicationInfo::WebApplicationInfo() {
105 is_bookmark_app = false; 105 is_bookmark_app = false;
106 is_offline_enabled = false;
106 } 107 }
107 108
108 WebApplicationInfo::~WebApplicationInfo() { 109 WebApplicationInfo::~WebApplicationInfo() {
109 } 110 }
110 111
111 112
112 namespace web_apps { 113 namespace web_apps {
113 114
114 gfx::Size ParseIconSize(const string16& text) { 115 gfx::Size ParseIconSize(const string16& text) {
115 std::vector<string16> sizes; 116 std::vector<string16> sizes;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 310
310 WebApplicationInfo::IconInfo icon; 311 WebApplicationInfo::IconInfo icon;
311 icon.url = icon_url; 312 icon.url = icon_url;
312 icon.width = size; 313 icon.width = size;
313 icon.height = size; 314 icon.height = size;
314 315
315 icons.push_back(icon); 316 icons.push_back(icon);
316 } 317 }
317 } 318 }
318 319
320 // Parse if offline mode is enabled.
Mihai Parparita -not on Chrome 2012/07/11 06:03:01 This comment is redundant, and should be removed.
321 definition->GetBoolean("offline_enabled", &web_app->is_offline_enabled);
322
319 CHECK(definition->GetString("name", &web_app->title)); 323 CHECK(definition->GetString("name", &web_app->title));
320 definition->GetString("description", &web_app->description); 324 definition->GetString("description", &web_app->description);
321 definition->GetString("launch_container", &web_app->launch_container); 325 definition->GetString("launch_container", &web_app->launch_container);
322 web_app->app_url = app_url; 326 web_app->app_url = app_url;
323 web_app->urls = urls; 327 web_app->urls = urls;
324 web_app->permissions = permissions; 328 web_app->permissions = permissions;
325 web_app->icons = icons; 329 web_app->icons = icons;
326 330
327 return true; 331 return true;
328 332
329 } 333 }
330 334
331 } // namespace web_apps 335 } // namespace web_apps
OLDNEW
« no previous file with comments | « chrome/common/web_apps.h ('k') | chrome/common/web_apps_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698