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

Side by Side Diff: chrome/browser/extensions/convert_web_app.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 | « no previous file | chrome/common/extensions/extension_messages.h » ('j') | chrome/common/web_apps.cc » ('J')
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/browser/extensions/convert_web_app.h" 5 #include "chrome/browser/extensions/convert_web_app.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 LOG(ERROR) << "Could not create temporary directory."; 96 LOG(ERROR) << "Could not create temporary directory.";
97 return NULL; 97 return NULL;
98 } 98 }
99 99
100 // Create the manifest 100 // Create the manifest
101 scoped_ptr<DictionaryValue> root(new DictionaryValue); 101 scoped_ptr<DictionaryValue> root(new DictionaryValue);
102 if (!web_app.is_bookmark_app) 102 if (!web_app.is_bookmark_app)
103 root->SetString(keys::kPublicKey, GenerateKey(web_app.manifest_url)); 103 root->SetString(keys::kPublicKey, GenerateKey(web_app.manifest_url));
104 else 104 else
105 root->SetString(keys::kPublicKey, GenerateKey(web_app.app_url)); 105 root->SetString(keys::kPublicKey, GenerateKey(web_app.app_url));
106
107 if (web_app.is_offline_enabled)
108 root->SetBoolean(keys::kOfflineEnabled, true);
109
106 root->SetString(keys::kName, UTF16ToUTF8(web_app.title)); 110 root->SetString(keys::kName, UTF16ToUTF8(web_app.title));
107 root->SetString(keys::kVersion, ConvertTimeToExtensionVersion(create_time)); 111 root->SetString(keys::kVersion, ConvertTimeToExtensionVersion(create_time));
108 root->SetString(keys::kDescription, UTF16ToUTF8(web_app.description)); 112 root->SetString(keys::kDescription, UTF16ToUTF8(web_app.description));
109 root->SetString(keys::kLaunchWebURL, web_app.app_url.spec()); 113 root->SetString(keys::kLaunchWebURL, web_app.app_url.spec());
110 114
111 if (!web_app.launch_container.empty()) 115 if (!web_app.launch_container.empty())
112 root->SetString(keys::kLaunchContainer, web_app.launch_container); 116 root->SetString(keys::kLaunchContainer, web_app.launch_container);
113 117
114 // Add the icons. 118 // Add the icons.
115 DictionaryValue* icons = new DictionaryValue(); 119 DictionaryValue* icons = new DictionaryValue();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 extension_flags, 188 extension_flags,
185 &error); 189 &error);
186 if (!extension) { 190 if (!extension) {
187 LOG(ERROR) << error; 191 LOG(ERROR) << error;
188 return NULL; 192 return NULL;
189 } 193 }
190 194
191 temp_dir.Take(); // The caller takes ownership of the directory. 195 temp_dir.Take(); // The caller takes ownership of the directory.
192 return extension; 196 return extension;
193 } 197 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension_messages.h » ('j') | chrome/common/web_apps.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698