summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gears_integration.cc8
-rw-r--r--chrome/browser/gears_integration.h13
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc3
-rw-r--r--chrome/browser/renderer_host/render_view_host.h5
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h7
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc5
-rw-r--r--chrome/browser/tab_contents/tab_contents.h11
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.h4
-rw-r--r--chrome/browser/ui/views/create_application_shortcut_view.cc3
-rw-r--r--chrome/browser/web_applications/web_app.cc12
-rw-r--r--chrome/browser/web_applications/web_app.h6
-rw-r--r--chrome/browser/web_applications/web_app_unittest.cc2
12 files changed, 44 insertions, 35 deletions
diff --git a/chrome/browser/gears_integration.cc b/chrome/browser/gears_integration.cc
index 1ab162a..d1f13cf 100644
--- a/chrome/browser/gears_integration.cc
+++ b/chrome/browser/gears_integration.cc
@@ -15,10 +15,10 @@
#include "chrome/browser/chrome_plugin_host.h"
#include "chrome/common/chrome_plugin_util.h"
#include "chrome/common/gears_api.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"
// The following 2 helpers are borrowed from the Gears codebase.
@@ -139,7 +139,7 @@ class CreateShortcutCommand : public CPCommandInterface {
CreateShortcutCommand(
const std::string& name, const std::string& orig_name,
const std::string& url, const std::string& description,
- const std::vector<WebApplicationInfo::IconInfo> &icons,
+ const std::vector<webkit_glue::WebApplicationInfo::IconInfo> &icons,
const SkBitmap& fallback_icon,
GearsCreateShortcutCallback* callback)
: name_(name), url_(url), description_(description),
@@ -157,7 +157,7 @@ class CreateShortcutCommand : public CPCommandInterface {
bool has_icon = false;
for (size_t i = 0; i < icons.size(); ++i) {
- const WebApplicationInfo::IconInfo& icon = icons[i];
+ const webkit_glue::WebApplicationInfo::IconInfo& icon = icons[i];
if (icon.width == 16 && icon.height == 16) {
has_icon = true;
InitIcon(SIZE_16x16, icon.url, 16, 16);
@@ -232,7 +232,7 @@ class CreateShortcutCommand : public CPCommandInterface {
DISABLE_RUNNABLE_METHOD_REFCOUNT(CreateShortcutCommand);
void GearsCreateShortcut(
- const WebApplicationInfo& app_info,
+ const webkit_glue::WebApplicationInfo& app_info,
const string16& fallback_name,
const GURL& fallback_url,
const SkBitmap& fallback_icon,
diff --git a/chrome/browser/gears_integration.h b/chrome/browser/gears_integration.h
index 6461377..4723c9b 100644
--- a/chrome/browser/gears_integration.h
+++ b/chrome/browser/gears_integration.h
@@ -18,7 +18,9 @@
class CPCommandInterface;
class GURL;
class SkBitmap;
+namespace webkit_glue {
struct WebApplicationInfo;
+}
// We use this in place of GearsShortcutData so we can keep browser-specific
// data on the structure.
@@ -38,11 +40,12 @@ void GearsSettingsPressed(gfx::NativeWindow parent_wnd);
typedef Callback2<const GearsShortcutData2&, bool>::Type
GearsCreateShortcutCallback;
-void GearsCreateShortcut(const WebApplicationInfo& app_info,
- const string16& fallback_name,
- const GURL& fallback_url,
- const SkBitmap& fallback_icon,
- GearsCreateShortcutCallback* callback);
+void GearsCreateShortcut(
+ const webkit_glue::WebApplicationInfo& app_info,
+ const string16& fallback_name,
+ const GURL& fallback_url,
+ const SkBitmap& fallback_icon,
+ GearsCreateShortcutCallback* callback);
// Call into Gears to query the list of shortcuts. Results will be returned
// asynchronously via the callback. The callback's arguments will be NULL
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 7c9c154..8e04211 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -45,12 +45,12 @@
#include "chrome/common/thumbnail_score.h"
#include "chrome/common/translate_errors.h"
#include "chrome/common/url_constants.h"
-#include "chrome/common/web_apps.h"
#include "gfx/native_widget_types.h"
#include "net/base/net_util.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
#include "webkit/glue/context_menu.h"
+#include "webkit/glue/dom_operations.h"
#include "webkit/glue/form_data.h"
#include "webkit/glue/form_field.h"
#include "webkit/glue/password_form_dom_manager.h"
@@ -62,6 +62,7 @@ using webkit_glue::FormData;
using webkit_glue::PasswordForm;
using webkit_glue::PasswordFormDomManager;
using webkit_glue::PasswordFormFillData;
+using webkit_glue::WebApplicationInfo;
using WebKit::WebConsoleMessage;
using WebKit::WebDragOperation;
using WebKit::WebDragOperationNone;
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 45d0b557..03b1cfd 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -44,7 +44,6 @@ struct ViewHostMsg_PageHasOSDD_Type;
struct ViewHostMsg_RunFileChooser_Params;
struct ViewHostMsg_ShowNotification_Params;
struct ViewMsg_Navigate_Params;
-struct WebApplicationInfo;
struct WebDropData;
struct WebPreferences;
struct UserMetricsAction;
@@ -59,6 +58,7 @@ class FormField;
struct PasswordForm;
struct PasswordFormFillData;
struct WebAccessibility;
+struct WebApplicationInfo;
} // namespace webkit_glue
namespace WebKit {
@@ -667,7 +667,8 @@ class RenderViewHost : public RenderWidgetHost {
const std::string& data,
int32 status);
- void OnDidGetApplicationInfo(int32 page_id, const WebApplicationInfo& info);
+ void OnDidGetApplicationInfo(int32 page_id,
+ const webkit_glue::WebApplicationInfo& info);
void OnMsgShouldCloseACK(bool proceed);
void OnQueryFormFieldAutoFill(int request_id,
bool form_autofilled,
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index 2a6f745..27c63ec 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -50,7 +50,6 @@ struct ViewHostMsg_DomMessage_Params;
struct ViewHostMsg_FrameNavigate_Params;
struct ViewHostMsg_PageHasOSDD_Type;
struct ViewHostMsg_RunFileChooser_Params;
-struct WebApplicationInfo;
struct WebDropData;
struct WebMenuItem;
class WebKeyboardEvent;
@@ -74,6 +73,7 @@ namespace webkit_glue {
struct FormData;
class FormField;
struct PasswordForm;
+struct WebApplicationInfo;
}
//
@@ -280,11 +280,10 @@ class RenderViewHostDelegate {
virtual void OnDisabledOutdatedPlugin(const string16& name,
const GURL& update_url) = 0;
- // Notification that a user's request to install an application has
- // completed.
+ // Notification that a request for install info has completed.
virtual void OnDidGetApplicationInfo(
int32 page_id,
- const WebApplicationInfo& app_info) = 0;
+ const webkit_glue::WebApplicationInfo& app_info) = 0;
// Notification that the contents of the page has been loaded.
virtual void OnPageContents(const GURL& url,
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 9b117ce..165f23a 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2059,8 +2059,9 @@ void TabContents::OnCrashedWorker() {
NULL, true));
}
-void TabContents::OnDidGetApplicationInfo(int32 page_id,
- const WebApplicationInfo& info) {
+void TabContents::OnDidGetApplicationInfo(
+ int32 page_id,
+ const webkit_glue::WebApplicationInfo& info) {
web_app_info_ = info;
if (delegate())
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index f8bad82..ec3a77a 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -38,9 +38,9 @@
#include "chrome/common/property_bag.h"
#include "chrome/common/renderer_preferences.h"
#include "chrome/common/translate_errors.h"
-#include "chrome/common/web_apps.h"
#include "gfx/native_widget_types.h"
#include "net/base/load_states.h"
+#include "webkit/glue/dom_operations.h"
namespace gfx {
class Rect;
@@ -285,7 +285,7 @@ class TabContents : public PageNavigator,
encoding_.clear();
}
- const WebApplicationInfo& web_app_info() const {
+ const webkit_glue::WebApplicationInfo& web_app_info() const {
return web_app_info_;
}
@@ -868,8 +868,9 @@ class TabContents : public PageNavigator,
virtual void OnMissingPluginStatus(int status);
virtual void OnCrashedPlugin(const FilePath& plugin_path);
virtual void OnCrashedWorker();
- virtual void OnDidGetApplicationInfo(int32 page_id,
- const WebApplicationInfo& info);
+ virtual void OnDidGetApplicationInfo(
+ int32 page_id,
+ const webkit_glue::WebApplicationInfo& info);
virtual void OnDisabledOutdatedPlugin(const string16& name,
const GURL& update_url);
virtual void OnPageContents(const GURL& url,
@@ -1114,7 +1115,7 @@ class TabContents : public PageNavigator,
FavIconHelper fav_icon_helper_;
// Cached web app info data.
- WebApplicationInfo web_app_info_;
+ webkit_glue::WebApplicationInfo web_app_info_;
// Cached web app icon.
SkBitmap app_icon_;
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h
index 7dfafe6..58497d5 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.h
+++ b/chrome/browser/tab_contents/tab_contents_delegate.h
@@ -28,7 +28,6 @@ namespace history {
class HistoryAddPageArgs;
}
-struct ContextMenuParams;
class DownloadItem;
class ExtensionFunctionDispatcher;
class GURL;
@@ -39,6 +38,7 @@ class RenderViewHost;
class TabContents;
class TemplateURL;
class TemplateURLModel;
+struct ContextMenuParams;
// Objects implement this interface to get notified about changes in the
// TabContents and to provide necessary functionality.
@@ -277,7 +277,7 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
const history::HistoryAddPageArgs& add_page_args,
NavigationType::Type navigation_type);
- // Notification that a user's request to install an application has completed.
+ // Notification when web app info data is available
virtual void OnDidGetApplicationInfo(TabContents* tab_contents,
int32 page_id);
diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc
index f0ec8ee..77e2ea6 100644
--- a/chrome/browser/ui/views/create_application_shortcut_view.cc
+++ b/chrome/browser/ui/views/create_application_shortcut_view.cc
@@ -236,7 +236,8 @@ void CreateApplicationShortcutView::Init() {
// Prepare data
web_app::GetShortcutInfoForTab(tab_contents_, &shortcut_info_);
- const WebApplicationInfo& app_info = tab_contents_->web_app_info();
+ const webkit_glue::WebApplicationInfo& app_info =
+ tab_contents_->web_app_info();
if (!app_info.icons.empty()) {
web_app::GetIconsInfo(app_info, &unprocessed_icons_);
FetchIcon();
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc
index 79fb3f7..fc385a6 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 "chrome/common/web_apps.h"
+#include "webkit/glue/dom_operations.h"
#if defined(OS_LINUX)
#include "base/environment.h"
@@ -114,8 +114,9 @@ FilePath GetWebAppDataDirectory(const FilePath& root_dir,
#if defined(TOOLKIT_VIEWS)
// Predicator for sorting images from largest to smallest.
-bool IconPrecedes(const WebApplicationInfo::IconInfo& left,
- const WebApplicationInfo::IconInfo& right) {
+bool IconPrecedes(
+ const webkit_glue::WebApplicationInfo::IconInfo& left,
+ const webkit_glue::WebApplicationInfo::IconInfo& right) {
return left.width < right.width;
}
#endif
@@ -722,7 +723,7 @@ FilePath GetDataDir(const FilePath& profile_path) {
}
#if defined(TOOLKIT_VIEWS)
-void GetIconsInfo(const WebApplicationInfo& app_info,
+void GetIconsInfo(const webkit_glue::WebApplicationInfo& app_info,
IconInfoList* icons) {
DCHECK(icons);
@@ -742,7 +743,8 @@ void GetShortcutInfoForTab(TabContents* tab_contents,
ShellIntegration::ShortcutInfo* info) {
DCHECK(info); // Must provide a valid info.
- const WebApplicationInfo& app_info = tab_contents->web_app_info();
+ const webkit_glue::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 4734b7e..c451e85 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 "chrome/common/web_apps.h"
+#include "webkit/glue/dom_operations.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<WebApplicationInfo::IconInfo> IconInfoList;
-void GetIconsInfo(const WebApplicationInfo& app_info,
+typedef std::vector<webkit_glue::WebApplicationInfo::IconInfo> IconInfoList;
+void GetIconsInfo(const webkit_glue::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 a999f33..a8fc395 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");
- WebApplicationInfo web_app_info;
+ webkit_glue::WebApplicationInfo web_app_info;
web_app_info.title = title;
web_app_info.description = description;
web_app_info.app_url = url;