summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/common_param_traits.cc4
-rw-r--r--chrome/common/render_messages_internal.h4
-rw-r--r--chrome/common/web_apps.cc23
-rw-r--r--chrome/common/web_apps.h4
-rw-r--r--chrome/common/web_apps_unittest.cc5
7 files changed, 14 insertions, 30 deletions
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index e272114..8e99e8e 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -426,9 +426,6 @@ const char kEnableConnectBackupJobs[] = "enable-connect-backup-jobs";
// Link: headers.
const char kEnableContentPrefetch[] = "enable-content-prefetch";
-// Enables web developers to create apps for Chrome without using crx packages.
-const char kEnableCrxlessWebApps[] = "enable-crxless-web-apps";
-
// Whether default apps should be installed in this profile. This flag has no
// effect on Chrome OS because default apps are always enabled there.
const char kEnableDefaultApps[] = "enable-default-apps";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 58943b8..1154171 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -130,7 +130,6 @@ extern const char kEnableCloudPrint[];
extern const char kEnableConfirmToQuit[];
extern const char kEnableConnectBackupJobs[];
extern const char kEnableContentPrefetch[];
-extern const char kEnableCrxlessWebApps[];
extern const char kEnableDefaultApps[];
extern const char kEnableDeviceMotion[];
extern const char kEnableDNSCertProvenanceChecking[];
diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc
index 165224c..ca5e90b 100644
--- a/chrome/common/common_param_traits.cc
+++ b/chrome/common/common_param_traits.cc
@@ -237,7 +237,6 @@ void ParamTraits<WebApplicationInfo>::Write(Message* m,
WriteParam(m, p.icons[i].url);
WriteParam(m, p.icons[i].width);
WriteParam(m, p.icons[i].height);
- WriteParam(m, p.icons[i].data);
}
}
@@ -256,8 +255,7 @@ bool ParamTraits<WebApplicationInfo>::Read(
result =
ReadParam(m, iter, &icon_info.url) &&
ReadParam(m, iter, &icon_info.width) &&
- ReadParam(m, iter, &icon_info.height) &&
- ReadParam(m, iter, &icon_info.data);
+ ReadParam(m, iter, &icon_info.height);
if (!result)
return false;
r->icons.push_back(icon_info);
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 6b1373a..adf6cde 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -1906,10 +1906,6 @@ IPC_BEGIN_MESSAGES(ViewHost)
int32 /* page_id */,
WebApplicationInfo)
- // Sent by the renderer to implement chrome.app.installApplication().
- IPC_MESSAGE_ROUTED1(ViewHostMsg_InstallApplication,
- WebApplicationInfo)
-
// Provides the result from running OnMsgShouldClose. |proceed| matches the
// return value of the the frame's shouldClose method (which includes the
// onbeforeunload handler): true if the user decided to proceed with leaving
diff --git a/chrome/common/web_apps.cc b/chrome/common/web_apps.cc
index b9c390c..cde9690 100644
--- a/chrome/common/web_apps.cc
+++ b/chrome/common/web_apps.cc
@@ -205,7 +205,7 @@ bool ParseWebAppFromWebDocument(WebFrame* frame,
return true;
}
-bool ParseWebAppFromDefinitionFile(Value* definition_value,
+bool ParseWebAppFromDefinitionFile(const DictionaryValue& definition,
WebApplicationInfo* web_app,
string16* error) {
CHECK(web_app->manifest_url.is_valid());
@@ -230,22 +230,17 @@ bool ParseWebAppFromDefinitionFile(Value* definition_value,
// and for forward compat with ourselves.
validator.set_default_allow_additional_properties(true);
- if (!validator.Validate(definition_value)) {
+ if (!validator.Validate(const_cast<DictionaryValue*>(&definition))) {
*error = UTF8ToUTF16(
validator.errors()[0].path + ": " + validator.errors()[0].message);
return false;
}
- // This must be true because the schema requires the root value to be a
- // dictionary.
- CHECK(definition_value->IsType(Value::TYPE_DICTIONARY));
- DictionaryValue* definition = static_cast<DictionaryValue*>(definition_value);
-
// Parse launch URL. It must be a valid URL in the same origin as the
// manifest.
std::string app_url_string;
GURL app_url;
- CHECK(definition->GetString("launch_url", &app_url_string));
+ CHECK(definition.GetString("launch_url", &app_url_string));
if (!(app_url = web_app->manifest_url.Resolve(app_url_string)).is_valid() ||
app_url.GetOrigin() != web_app->manifest_url.GetOrigin()) {
*error = UTF8ToUTF16(WebApplicationInfo::kInvalidLaunchURL);
@@ -255,7 +250,7 @@ bool ParseWebAppFromDefinitionFile(Value* definition_value,
// Parse out the permissions if present.
std::vector<std::string> permissions;
ListValue* permissions_value = NULL;
- if (definition->GetList("permissions", &permissions_value)) {
+ if (definition.GetList("permissions", &permissions_value)) {
for (size_t i = 0; i < permissions_value->GetSize(); ++i) {
std::string permission;
CHECK(permissions_value->GetString(i, &permission));
@@ -266,7 +261,7 @@ bool ParseWebAppFromDefinitionFile(Value* definition_value,
// Parse out the URLs if present.
std::vector<GURL> urls;
ListValue* urls_value = NULL;
- if (definition->GetList("urls", &urls_value)) {
+ if (definition.GetList("urls", &urls_value)) {
for (size_t i = 0; i < urls_value->GetSize(); ++i) {
std::string url_string;
GURL url;
@@ -285,7 +280,7 @@ bool ParseWebAppFromDefinitionFile(Value* definition_value,
// Parse out the icons if present.
std::vector<WebApplicationInfo::IconInfo> icons;
DictionaryValue* icons_value = NULL;
- if (definition->GetDictionary("icons", &icons_value)) {
+ if (definition.GetDictionary("icons", &icons_value)) {
for (DictionaryValue::key_iterator iter = icons_value->begin_keys();
iter != icons_value->end_keys(); ++iter) {
// Ignore unknown properties. Better for forward compat.
@@ -313,9 +308,9 @@ bool ParseWebAppFromDefinitionFile(Value* definition_value,
}
}
- CHECK(definition->GetString("name", &web_app->title));
- definition->GetString("description", &web_app->description);
- definition->GetString("launch_container", &web_app->launch_container);
+ CHECK(definition.GetString("name", &web_app->title));
+ definition.GetString("description", &web_app->description);
+ definition.GetString("launch_container", &web_app->launch_container);
web_app->app_url = app_url;
web_app->urls = urls;
web_app->permissions = permissions;
diff --git a/chrome/common/web_apps.h b/chrome/common/web_apps.h
index 91f2023..6d40883 100644
--- a/chrome/common/web_apps.h
+++ b/chrome/common/web_apps.h
@@ -19,7 +19,7 @@ class WebDocument;
class WebFrame;
}
-class Value;
+class DictionaryValue;
// Structure used when installing a web page as an app.
struct WebApplicationInfo {
@@ -100,7 +100,7 @@ bool ParseWebAppFromWebDocument(WebKit::WebFrame* frame,
// Parses |web_app| information out of |definition|. Returns true on success, or
// false and |error| on failure. This function assumes that |web_app| has a
// valid manifest_url.
-bool ParseWebAppFromDefinitionFile(Value* definition,
+bool ParseWebAppFromDefinitionFile(const DictionaryValue& definition,
WebApplicationInfo* web_app,
string16* error);
diff --git a/chrome/common/web_apps_unittest.cc b/chrome/common/web_apps_unittest.cc
index fc8b121..3a6980e 100644
--- a/chrome/common/web_apps_unittest.cc
+++ b/chrome/common/web_apps_unittest.cc
@@ -52,7 +52,7 @@ WebApplicationInfo* ParseFromDefinitionAndExpectSuccess(
web_app->manifest_url = GURL("http://example.com/");
string16 error;
- if (!web_apps::ParseWebAppFromDefinitionFile(defintion.get(), web_app.get(),
+ if (!web_apps::ParseWebAppFromDefinitionFile(*defintion, web_app.get(),
&error)) {
ADD_FAILURE() << "Error parsing " << name << ": " << UTF16ToUTF8(error);
return NULL;
@@ -71,8 +71,7 @@ void ParseFromDefinitionAndExpectFailure(const std::string& name,
web_app.manifest_url = GURL("http://example.com/");
string16 error;
- if (web_apps::ParseWebAppFromDefinitionFile(definition.get(), &web_app,
- &error)) {
+ if (web_apps::ParseWebAppFromDefinitionFile(*definition, &web_app, &error)) {
ADD_FAILURE() << "Expected error parsing " << name
<< " but parse succeeded.";
return;