diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-17 05:14:15 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-17 05:14:15 +0000 |
commit | 1631f7c651fbc7f4460a852126f545afc5513531 (patch) | |
tree | 7176f3052f69c0c0debf48172d533f9acc4c83d3 /chrome/browser/web_applications | |
parent | 42a17153ee389574560b91b185bcec6c4db5b5c3 (diff) | |
download | chromium_src-1631f7c651fbc7f4460a852126f545afc5513531.zip chromium_src-1631f7c651fbc7f4460a852126f545afc5513531.tar.gz chromium_src-1631f7c651fbc7f4460a852126f545afc5513531.tar.bz2 |
Implement web app definition parsing.
This required moving some code from webkit/glue to
chrome/common/web_apps.cc so that it could rely on
chrome/common/json_schema_validator.h.
BUG=49233
TEST=Convered by unit tests.
Review URL: http://codereview.chromium.org/4979003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_applications')
-rw-r--r-- | chrome/browser/web_applications/web_app.cc | 12 | ||||
-rw-r--r-- | chrome/browser/web_applications/web_app.h | 6 | ||||
-rw-r--r-- | chrome/browser/web_applications/web_app_unittest.cc | 2 |
3 files changed, 9 insertions, 11 deletions
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index fc385a6..79fb3f7 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc @@ -32,7 +32,7 @@ #include "chrome/common/notification_registrar.h" #include "chrome/common/notification_service.h" #include "chrome/common/url_constants.h" -#include "webkit/glue/dom_operations.h" +#include "chrome/common/web_apps.h" #if defined(OS_LINUX) #include "base/environment.h" @@ -114,9 +114,8 @@ FilePath GetWebAppDataDirectory(const FilePath& root_dir, #if defined(TOOLKIT_VIEWS) // Predicator for sorting images from largest to smallest. -bool IconPrecedes( - const webkit_glue::WebApplicationInfo::IconInfo& left, - const webkit_glue::WebApplicationInfo::IconInfo& right) { +bool IconPrecedes(const WebApplicationInfo::IconInfo& left, + const WebApplicationInfo::IconInfo& right) { return left.width < right.width; } #endif @@ -723,7 +722,7 @@ FilePath GetDataDir(const FilePath& profile_path) { } #if defined(TOOLKIT_VIEWS) -void GetIconsInfo(const webkit_glue::WebApplicationInfo& app_info, +void GetIconsInfo(const WebApplicationInfo& app_info, IconInfoList* icons) { DCHECK(icons); @@ -743,8 +742,7 @@ void GetShortcutInfoForTab(TabContents* tab_contents, ShellIntegration::ShortcutInfo* info) { DCHECK(info); // Must provide a valid info. - const webkit_glue::WebApplicationInfo& app_info = - tab_contents->web_app_info(); + const WebApplicationInfo& app_info = tab_contents->web_app_info(); info->url = app_info.app_url.is_empty() ? tab_contents->GetURL() : app_info.app_url; diff --git a/chrome/browser/web_applications/web_app.h b/chrome/browser/web_applications/web_app.h index c451e85..4734b7e 100644 --- a/chrome/browser/web_applications/web_app.h +++ b/chrome/browser/web_applications/web_app.h @@ -11,7 +11,7 @@ #include "base/callback.h" #include "build/build_config.h" #include "chrome/browser/shell_integration.h" -#include "webkit/glue/dom_operations.h" +#include "chrome/common/web_apps.h" class FilePath; class Profile; @@ -47,8 +47,8 @@ FilePath GetDataDir(const FilePath& profile_path); #if defined(TOOLKIT_VIEWS) // Extracts icons info from web app data. Take only square shaped icons and // sort them from smallest to largest. -typedef std::vector<webkit_glue::WebApplicationInfo::IconInfo> IconInfoList; -void GetIconsInfo(const webkit_glue::WebApplicationInfo& app_info, +typedef std::vector<WebApplicationInfo::IconInfo> IconInfoList; +void GetIconsInfo(const WebApplicationInfo& app_info, IconInfoList* icons); #endif diff --git a/chrome/browser/web_applications/web_app_unittest.cc b/chrome/browser/web_applications/web_app_unittest.cc index a8fc395..a999f33 100644 --- a/chrome/browser/web_applications/web_app_unittest.cc +++ b/chrome/browser/web_applications/web_app_unittest.cc @@ -43,7 +43,7 @@ TEST_F(WebApplicationTest, GetShortcutInfoForTab) { const string16 title = ASCIIToUTF16("TEST_TITLE"); const string16 description = ASCIIToUTF16("TEST_DESCRIPTION"); const GURL url("http://www.foo.com/bar"); - webkit_glue::WebApplicationInfo web_app_info; + WebApplicationInfo web_app_info; web_app_info.title = title; web_app_info.description = description; web_app_info.app_url = url; |