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

Unified Diff: chrome/browser/extensions/convert_web_app.cc

Issue 4979003: Implement web app definition parsing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/convert_web_app.cc
diff --git a/chrome/browser/extensions/convert_web_app.cc b/chrome/browser/extensions/convert_web_app.cc
index 40bc886c6469e705e81c64d9a4a8d9d1f4c4ba9a..bba245a19178ab318cc548fce1feb749e84d2757 100644
--- a/chrome/browser/extensions/convert_web_app.cc
+++ b/chrome/browser/extensions/convert_web_app.cc
@@ -22,10 +22,10 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/json_value_serializer.h"
+#include "chrome/common/web_apps.h"
#include "gfx/codec/png_codec.h"
#include "googleurl/src/gurl.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "webkit/glue/dom_operations.h"
namespace keys = extension_manifest_keys;
@@ -81,8 +81,8 @@ std::string ConvertTimeToExtensionVersion(const Time& create_time) {
}
scoped_refptr<Extension> ConvertWebAppToExtension(
- const webkit_glue::WebApplicationInfo& web_app,
- const Time& create_time) {
+ const WebApplicationInfo& web_app,
+ const base::Time& create_time) {
FilePath user_data_temp_dir;
CHECK(PathService::Get(chrome::DIR_USER_DATA_TEMP, &user_data_temp_dir));
@@ -100,6 +100,13 @@ scoped_refptr<Extension> ConvertWebAppToExtension(
root->SetString(keys::kDescription, UTF16ToUTF8(web_app.description));
root->SetString(keys::kLaunchWebURL, web_app.app_url.spec());
+ if (web_app.launch_container == "panel") {
+ root->SetString(keys::kLaunchContainer,
+ extension_manifest_values::kLaunchContainerPanel);
+ }
+
+ // TODO(aa): kConvertedFromWebApp?
+
// Add the icons.
DictionaryValue* icons = new DictionaryValue();
root->Set(keys::kIcons, icons);
@@ -110,11 +117,11 @@ scoped_refptr<Extension> ConvertWebAppToExtension(
icons->SetString(size, icon_path);
}
- // Add the permissions.
+ // Add the permissions. In web apps, these are called 'privileges'.
Erik does not do reviews 2010/11/15 19:45:36 I'm not sure we want to make this change just yet.
Aaron Boodman 2010/11/16 03:44:45 I decided to land these changes in a different ord
ListValue* permissions = new ListValue();
root->Set(keys::kPermissions, permissions);
- for (size_t i = 0; i < web_app.permissions.size(); ++i) {
- permissions->Append(Value::CreateStringValue(web_app.permissions[i]));
+ for (size_t i = 0; i < web_app.privileges.size(); ++i) {
+ permissions->Append(Value::CreateStringValue(web_app.privileges[i]));
}
// Add the URLs.

Powered by Google App Engine
This is Rietveld 408576698