summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-05 03:26:29 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-05 03:26:29 +0000
commite09ba55021ea324864cff41148a0d3ee65539963 (patch)
tree1d9fb31246f6029e3ab9fe56b334c01634ca7436 /webkit/glue
parenta9358722ff8a3955c5b4a7430fc16af314653d50 (diff)
downloadchromium_src-e09ba55021ea324864cff41148a0d3ee65539963.zip
chromium_src-e09ba55021ea324864cff41148a0d3ee65539963.tar.gz
chromium_src-e09ba55021ea324864cff41148a0d3ee65539963.tar.bz2
Finish taking out render_messages.h includes from headers.
Review URL: http://codereview.chromium.org/20072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9209 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/context_menu.h111
-rw-r--r--webkit/glue/context_menu_client_impl.cc2
-rw-r--r--webkit/glue/context_node_types.h57
-rw-r--r--webkit/glue/dragclient_impl.cc2
-rw-r--r--webkit/glue/glue.vcproj2
-rw-r--r--webkit/glue/glue_accessibility.cc7
-rw-r--r--webkit/glue/glue_accessibility.h7
-rw-r--r--webkit/glue/webview_delegate.h2
8 files changed, 121 insertions, 69 deletions
diff --git a/webkit/glue/context_menu.h b/webkit/glue/context_menu.h
new file mode 100644
index 0000000..e14462f
--- /dev/null
+++ b/webkit/glue/context_menu.h
@@ -0,0 +1,111 @@
+// Copyright (c) 2006-2008 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.
+
+#ifndef WEBKIT_GLUE_CONTEXT_NODE_TYPES_H__
+#define WEBKIT_GLUE_CONTEXT_NODE_TYPES_H__
+
+#include "base/basictypes.h"
+#include "googleurl/src/gurl.h"
+
+// The type of node that the user may perform a contextual action on
+// in the WebView.
+struct ContextNode {
+ enum TypeBit {
+ // No node is selected
+ NONE = 0x0,
+
+ // The top page is selected
+ PAGE = 0x1,
+
+ // A subframe page is selected
+ FRAME = 0x2,
+
+ // A link is selected
+ LINK = 0x4,
+
+ // An image is selected
+ IMAGE = 0x8,
+
+ // There is a textual or mixed selection that is selected
+ SELECTION = 0x10,
+
+ // An editable element is selected
+ EDITABLE = 0x20,
+
+ // A misspelled word is selected
+ MISSPELLED_WORD = 0x40,
+ };
+
+ enum Capability {
+ CAN_DO_NONE = 0x0,
+ CAN_UNDO = 0x1,
+ CAN_REDO = 0x2,
+ CAN_CUT = 0x4,
+ CAN_COPY = 0x8,
+ CAN_PASTE = 0x10,
+ CAN_DELETE = 0x20,
+ CAN_SELECT_ALL = 0x40,
+ };
+
+ int32 type;
+ ContextNode() : type(NONE) {}
+ explicit ContextNode(int32 t) : type(t) {}
+};
+
+// Parameters structure for ViewHostMsg_ContextMenu.
+// FIXME(beng): This would be more useful in the future and more efficient
+// if the parameters here weren't so literally mapped to what
+// they contain for the ContextMenu task. It might be better
+// to make the string fields more generic so that this object
+// could be used for more contextual actions.
+struct ContextMenuParams {
+ // This is the type of Context Node that the context menu was invoked on.
+ ContextNode node;
+
+ // These values represent the coordinates of the mouse when the context menu
+ // was invoked. Coords are relative to the associated RenderView's origin.
+ int x;
+ int y;
+
+ // This is the URL of the link that encloses the node the context menu was
+ // invoked on.
+ GURL link_url;
+
+ // This is the URL of the image the context menu was invoked on.
+ GURL image_url;
+
+ // This is the URL of the top level page that the context menu was invoked
+ // on.
+ GURL page_url;
+
+ // This is the URL of the subframe that the context menu was invoked on.
+ GURL frame_url;
+
+ // This is the text of the selection that the context menu was invoked on.
+ std::wstring selection_text;
+
+ // The misspelled word under the cursor, if any. Used to generate the
+ // |dictionary_suggestions| list.
+ std::wstring misspelled_word;
+
+ // Suggested replacements for a misspelled word under the cursor.
+ // This vector gets populated in the render process host
+ // by intercepting ViewHostMsg_ContextMenu in ResourceMessageFilter
+ // and populating dictionary_suggestions if the type is EDITABLE
+ // and the misspelled_word is not empty.
+ std::vector<std::wstring> dictionary_suggestions;
+
+ // If editable, flag for whether spell check is enabled or not.
+ bool spellcheck_enabled;
+
+ // These flags indicate to the browser whether the renderer believes it is
+ // able to perform the corresponding action.
+ int edit_flags;
+
+ // The security info for the resource we are showing the menu on.
+ std::string security_info;
+};
+
+#endif // WEBKIT_GLUE_CONTEXT_NODE_TYPES_H__
+
diff --git a/webkit/glue/context_menu_client_impl.cc b/webkit/glue/context_menu_client_impl.cc
index 30f5e1a..2d7a074 100644
--- a/webkit/glue/context_menu_client_impl.cc
+++ b/webkit/glue/context_menu_client_impl.cc
@@ -23,7 +23,7 @@ MSVC_POP_WARNING();
#include "webkit/glue/context_menu_client_impl.h"
#include "base/string_util.h"
-#include "webkit/glue/context_node_types.h"
+#include "webkit/glue/context_menu.h"
#include "webkit/glue/glue_util.h"
#include "webkit/glue/webdocumentloader_impl.h"
#include "webkit/glue/webview_impl.h"
diff --git a/webkit/glue/context_node_types.h b/webkit/glue/context_node_types.h
deleted file mode 100644
index b20814a..0000000
--- a/webkit/glue/context_node_types.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef WEBKIT_GLUE_CONTEXT_NODE_TYPES_H__
-#define WEBKIT_GLUE_CONTEXT_NODE_TYPES_H__
-
-#include "base/basictypes.h"
-#include "base/logging.h"
-
-// The type of node that the user may perform a contextual action on
-// in the WebView.
-struct ContextNode {
- enum TypeBit {
- // No node is selected
- NONE = 0x0,
-
- // The top page is selected
- PAGE = 0x1,
-
- // A subframe page is selected
- FRAME = 0x2,
-
- // A link is selected
- LINK = 0x4,
-
- // An image is selected
- IMAGE = 0x8,
-
- // There is a textual or mixed selection that is selected
- SELECTION = 0x10,
-
- // An editable element is selected
- EDITABLE = 0x20,
-
- // A misspelled word is selected
- MISSPELLED_WORD = 0x40,
- };
-
- enum Capability {
- CAN_DO_NONE = 0x0,
- CAN_UNDO = 0x1,
- CAN_REDO = 0x2,
- CAN_CUT = 0x4,
- CAN_COPY = 0x8,
- CAN_PASTE = 0x10,
- CAN_DELETE = 0x20,
- CAN_SELECT_ALL = 0x40,
- };
-
- int32 type;
- ContextNode() : type(NONE) {}
- explicit ContextNode(int32 t) : type(t) {}
-};
-
-#endif // WEBKIT_GLUE_CONTEXT_NODE_TYPES_H__
-
diff --git a/webkit/glue/dragclient_impl.cc b/webkit/glue/dragclient_impl.cc
index 25654b0..d9b7896 100644
--- a/webkit/glue/dragclient_impl.cc
+++ b/webkit/glue/dragclient_impl.cc
@@ -21,7 +21,7 @@ MSVC_POP_WARNING();
#include "base/logging.h"
#include "base/string_util.h"
#include "webkit/glue/clipboard_conversion.h"
-#include "webkit/glue/context_node_types.h"
+#include "webkit/glue/context_menu.h"
#include "webkit/glue/glue_util.h"
#include "webkit/glue/webdropdata.h"
#include "webkit/glue/webview_delegate.h"
diff --git a/webkit/glue/glue.vcproj b/webkit/glue/glue.vcproj
index f44284e..8baa129 100644
--- a/webkit/glue/glue.vcproj
+++ b/webkit/glue/glue.vcproj
@@ -141,7 +141,7 @@
>
</File>
<File
- RelativePath=".\context_node_types.h"
+ RelativePath=".\context_menu.h"
>
</File>
<File
diff --git a/webkit/glue/glue_accessibility.cc b/webkit/glue/glue_accessibility.cc
index 2d0c8f4..cd9cfd6 100644
--- a/webkit/glue/glue_accessibility.cc
+++ b/webkit/glue/glue_accessibility.cc
@@ -20,9 +20,6 @@
#include "webkit/glue/webframe_impl.h"
#include "webkit/glue/webview_impl.h"
-// TODO: Remove this evil dependency on Chrome!
-#include "chrome/browser/iaccessible_function_ids.h"
-
// struct GlueAccessibility::GlueAccessibilityRoot
struct GlueAccessibility::GlueAccessibilityRoot {
GlueAccessibilityRoot() {}
@@ -41,8 +38,8 @@ GlueAccessibility::~GlueAccessibility() {
}
bool GlueAccessibility::GetAccessibilityInfo(WebView* view,
- const ViewMsg_Accessibility_In_Params& in_params,
- ViewHostMsg_Accessibility_Out_Params* out_params) {
+ const AccessibilityInParams& in_params,
+ AccessibilityOutParams* out_params) {
WebFrame* main_frame = view->GetMainFrame();
if (!main_frame || !static_cast<WebFrameImpl*>(main_frame)->frameview())
return false;
diff --git a/webkit/glue/glue_accessibility.h b/webkit/glue/glue_accessibility.h
index b801582..2976c68 100644
--- a/webkit/glue/glue_accessibility.h
+++ b/webkit/glue/glue_accessibility.h
@@ -14,7 +14,8 @@ class IAccessible;
#endif
#include "base/hash_tables.h"
-#include "chrome/common/render_messages.h"
+#include "base/ref_counted.h"
+#include "chrome/common/accessibility.h"
class WebView;
@@ -40,8 +41,8 @@ class GlueAccessibility {
// currently active (browser ref count not zero) IAccessibles. Returns true if
// successful, false otherwise.
bool GetAccessibilityInfo(WebView* view,
- const ViewMsg_Accessibility_In_Params& in_params,
- ViewHostMsg_Accessibility_Out_Params* out_params);
+ const AccessibilityInParams& in_params,
+ AccessibilityOutParams* out_params);
// Erases the entry identified by the |iaccessible_id| from the hash map. If
// |clear_all| is true, all entries are erased. Returns true if successful,
diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h
index 982ec49..955985e 100644
--- a/webkit/glue/webview_delegate.h
+++ b/webkit/glue/webview_delegate.h
@@ -32,7 +32,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "googleurl/src/gurl.h"
-#include "webkit/glue/context_node_types.h"
+#include "webkit/glue/context_menu.h"
#include "webkit/glue/webwidget_delegate.h"
#include "webkit/glue/window_open_disposition.h"