summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/extension_messages.h1
-rw-r--r--chrome/common/web_apps.cc4
-rw-r--r--chrome/common/web_apps.h5
-rw-r--r--chrome/common/web_apps_unittest.cc1
4 files changed, 10 insertions, 1 deletions
diff --git a/chrome/common/extensions/extension_messages.h b/chrome/common/extensions/extension_messages.h
index b09b18c..82f66e3 100644
--- a/chrome/common/extensions/extension_messages.h
+++ b/chrome/common/extensions/extension_messages.h
@@ -92,6 +92,7 @@ IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo)
IPC_STRUCT_TRAITS_MEMBER(icons)
IPC_STRUCT_TRAITS_MEMBER(permissions)
IPC_STRUCT_TRAITS_MEMBER(launch_container)
+ IPC_STRUCT_TRAITS_MEMBER(is_offline_enabled)
IPC_STRUCT_TRAITS_END()
// Singly-included section for custom IPC traits.
diff --git a/chrome/common/web_apps.cc b/chrome/common/web_apps.cc
index 8a2cdcc..a2d1d7e 100644
--- a/chrome/common/web_apps.cc
+++ b/chrome/common/web_apps.cc
@@ -103,6 +103,7 @@ const char WebApplicationInfo::kInvalidIconURL[] =
WebApplicationInfo::WebApplicationInfo() {
is_bookmark_app = false;
+ is_offline_enabled = false;
}
WebApplicationInfo::~WebApplicationInfo() {
@@ -316,6 +317,9 @@ bool ParseWebAppFromDefinitionFile(Value* definition_value,
}
}
+ // Parse if offline mode is enabled.
+ definition->GetBoolean("offline_enabled", &web_app->is_offline_enabled);
+
CHECK(definition->GetString("name", &web_app->title));
definition->GetString("description", &web_app->description);
definition->GetString("launch_container", &web_app->launch_container);
diff --git a/chrome/common/web_apps.h b/chrome/common/web_apps.h
index e0526b6..b3ea039 100644
--- a/chrome/common/web_apps.h
+++ b/chrome/common/web_apps.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -74,6 +74,9 @@ struct WebApplicationInfo {
// The type of launch container to use with the app. Currently supported
// values are 'tab' and 'panel'. Only supported with manifest-based apps.
std::string launch_container;
+
+ // This indicates if the app is functional in offline mode or not.
+ bool is_offline_enabled;
};
diff --git a/chrome/common/web_apps_unittest.cc b/chrome/common/web_apps_unittest.cc
index 20db234..5f71fcd 100644
--- a/chrome/common/web_apps_unittest.cc
+++ b/chrome/common/web_apps_unittest.cc
@@ -134,6 +134,7 @@ TEST(WebAppInfo, Full) {
EXPECT_EQ("geolocation", web_app->permissions[0]);
EXPECT_EQ("notifications", web_app->permissions[1]);
EXPECT_EQ("panel", web_app->launch_container);
+ EXPECT_EQ(true, web_app->is_offline_enabled);
}
// Tests ParseIconSizes with various input.