diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 18:08:40 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 18:08:40 +0000 |
commit | 4f999134a2e270792abc8b5ac6ad70aa500dcef4 (patch) | |
tree | e90d972ee2f29d10d6e22220d54cd142925bb2bb /webkit | |
parent | b5cd43eb964e452d7a0245b9e14bd9a9d1e89b4a (diff) | |
download | chromium_src-4f999134a2e270792abc8b5ac6ad70aa500dcef4.zip chromium_src-4f999134a2e270792abc8b5ac6ad70aa500dcef4.tar.gz chromium_src-4f999134a2e270792abc8b5ac6ad70aa500dcef4.tar.bz2 |
Use WebScriptSource and WebFindInPageRequest from the WebKit API.
This change introduces some helper functions in glue_util.cc for efficient
conversion between WebString and WebCore::String when inside the implementation
of webkit/glue. This is a temporary change since eventually all code in glue
that uses WebCore will be moved into the WebKit API implementation.
Instead of making the Chrome automation use WebFindInPageRequest, I decided to
introduce AutomationMsg_Find_Params as a copy of the old FindInPageRequest
structure. That preserves the IPC protocol and avoids making the automation
library depend on WebKit.
R=dglazkov
Review URL: http://codereview.chromium.org/57060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12881 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/build/WebKit/WebKit.vcproj | 8 | ||||
-rw-r--r-- | webkit/glue/find_in_page_request.h | 30 | ||||
-rw-r--r-- | webkit/glue/glue_util.cc | 38 | ||||
-rw-r--r-- | webkit/glue/glue_util.h | 13 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsclient_impl.cc | 7 | ||||
-rw-r--r-- | webkit/glue/webframe.h | 15 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.cc | 50 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.h | 15 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.cc | 5 | ||||
-rw-r--r-- | webkit/glue/webscriptsource.h | 29 | ||||
-rw-r--r-- | webkit/tools/test_shell/plugin_tests.cc | 10 | ||||
-rw-r--r-- | webkit/webkit.gyp | 4 |
12 files changed, 117 insertions, 107 deletions
diff --git a/webkit/build/WebKit/WebKit.vcproj b/webkit/build/WebKit/WebKit.vcproj index 216bdbf..a61dd47f 100644 --- a/webkit/build/WebKit/WebKit.vcproj +++ b/webkit/build/WebKit/WebKit.vcproj @@ -152,6 +152,10 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebFindInPageRequest.h" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebImage.h" > </File> @@ -176,6 +180,10 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebScriptSource.h" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebSize.h" > </File> diff --git a/webkit/glue/find_in_page_request.h b/webkit/glue/find_in_page_request.h deleted file mode 100644 index 8594f05..0000000 --- a/webkit/glue/find_in_page_request.h +++ /dev/null @@ -1,30 +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_FIND_IN_PAGE_REQUEST_H__ -#define WEBKIT_GLUE_FIND_IN_PAGE_REQUEST_H__ - -#include "base/string16.h" - -// Parameters for a find in page request. -struct FindInPageRequest { - // The id for the request, this message is passed in by the caller and - // returned back with the reply so that the caller can start a new search and - // choose to ignore packets that belonged to the last search. - int request_id; - - // The word(s) to find on the page. - string16 search_string; - - // Whether to search forward or backward within the page. - bool forward; - - // Whether search should be Case sensitive. - bool match_case; - - // Whether this operation is first request (Find) or a follow-up (FindNext). - bool find_next; -}; - -#endif // WEBKIT_GLUE_FIND_IN_PAGE_REQUEST_H__ diff --git a/webkit/glue/glue_util.cc b/webkit/glue/glue_util.cc index 05a395a..2601970 100644 --- a/webkit/glue/glue_util.cc +++ b/webkit/glue/glue_util.cc @@ -2,6 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// TODO(darin): This file will be deleted once we complete the move to +// third_party/WebKit/WebKit/chromium + +// In this file, we pretend to be part of the WebKit implementation. +// This is just a temporary hack while glue is still being moved into +// third_party/WebKit/WebKit/chromium. +#define WEBKIT_IMPLEMENTATION 1 + #include "config.h" #include "webkit/glue/glue_util.h" @@ -20,11 +28,7 @@ #include "base/sys_string_conversions.h" #include "googleurl/src/gurl.h" #include "third_party/WebKit/WebKit/chromium/public/WebString.h" - - -// TODO(darin): This file will be deleted once we complete the move to -// third_party/WebKit/WebKit/chromium - +#include "third_party/WebKit/WebKit/chromium/public/WebURL.h" namespace webkit_glue { @@ -82,6 +86,22 @@ WebCore::String StdStringToString(const std::string& str) { static_cast<unsigned>(str.length())); } +WebKit::WebString StringToWebString(const WebCore::String& str) { + return str; +} + +WebCore::String WebStringToString(const WebKit::WebString& str) { + return str; +} + +WebKit::WebCString CStringToWebCString(const WebCore::CString& str) { + return str; +} + +WebCore::CString WebCStringToCString(const WebKit::WebCString& str) { + return str; +} + FilePath::StringType StringToFilePathString(const WebCore::String& str) { #if defined(OS_WIN) return StringToStdWString(str); @@ -127,6 +147,14 @@ GURL StringToGURL(const WebCore::String& spec) { return GURL(WideToUTF8(StringToStdWString(spec))); } +WebKit::WebURL KURLToWebURL(const WebCore::KURL& url) { + return url; +} + +WebCore::KURL WebURLToKURL(const WebKit::WebURL& url) { + return url; +} + // Rect conversions ------------------------------------------------------------ gfx::Rect FromIntRect(const WebCore::IntRect& r) { diff --git a/webkit/glue/glue_util.h b/webkit/glue/glue_util.h index adbaffc..5c9f90b 100644 --- a/webkit/glue/glue_util.h +++ b/webkit/glue/glue_util.h @@ -18,7 +18,9 @@ class String; } namespace WebKit { +class WebCString; class WebString; +class WebURL; } namespace gfx { @@ -47,6 +49,14 @@ WebCore::String String16ToString(const string16& str); std::string StringToStdString(const WebCore::String& str); WebCore::String StdStringToString(const std::string& str); +// WebCore::String <-> WebString. No charset conversion. +WebKit::WebString StringToWebString(const WebCore::String& str); +WebCore::String WebStringToString(const WebKit::WebString& str); + +// WebCore::CString <-> WebCString. No charset conversion. +WebKit::WebCString CStringToWebCString(const WebCore::CString& str); +WebCore::CString WebCStringToCString(const WebKit::WebCString& str); + FilePath::StringType StringToFilePathString(const WebCore::String& str); WebCore::String FilePathStringToString(const FilePath::StringType& str); @@ -57,6 +67,9 @@ GURL KURLToGURL(const WebCore::KURL& url); WebCore::KURL GURLToKURL(const GURL& url); GURL StringToGURL(const WebCore::String& spec); +WebKit::WebURL KURLToWebURL(const WebCore::KURL& url); +WebCore::KURL WebURLToKURL(const WebKit::WebURL& url); + gfx::Rect FromIntRect(const WebCore::IntRect& r); WebCore::IntRect ToIntRect(const gfx::Rect& r); diff --git a/webkit/glue/webdevtoolsclient_impl.cc b/webkit/glue/webdevtoolsclient_impl.cc index 231b4cf..53f1632 100644 --- a/webkit/glue/webdevtoolsclient_impl.cc +++ b/webkit/glue/webdevtoolsclient_impl.cc @@ -21,7 +21,7 @@ #include "base/json_writer.h" #include "base/string_util.h" #include "base/values.h" - +#include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h" #include "webkit/glue/devtools/debugger_agent.h" #include "webkit/glue/devtools/devtools_rpc_js.h" #include "webkit/glue/devtools/dom_agent.h" @@ -40,6 +40,8 @@ using WebCore::Node; using WebCore::Page; using WebCore::SecurityOrigin; using WebCore::String; +using WebKit::WebScriptSource; +using WebKit::WebString; DEFINE_RPC_JS_BOUND_OBJ(DebuggerAgent, DEBUGGER_AGENT_STRUCT, DebuggerAgentDelegate, DEBUGGER_AGENT_DELEGATE_STRUCT) @@ -126,7 +128,8 @@ void WebDevToolsClientImpl::DispatchMessageFromAgent( || net_agent_obj_->Dispatch(*message.get(), &expr) || tools_agent_obj_->Dispatch(*message.get(), &expr) || debugger_agent_obj_->Dispatch(*message.get(), &expr)) { - web_view_impl_->GetMainFrame()->ExecuteScript(expr); + web_view_impl_->GetMainFrame()->ExecuteScript( + WebScriptSource(WebString::fromUTF8(expr))); } } diff --git a/webkit/glue/webframe.h b/webkit/glue/webframe.h index 8f38362..ddd1b21 100644 --- a/webkit/glue/webframe.h +++ b/webkit/glue/webframe.h @@ -11,8 +11,6 @@ #include "skia/ext/platform_canvas.h" #include "webkit/glue/console_message_level.h" #include "webkit/glue/feed.h" -#include "webkit/glue/find_in_page_request.h" -#include "webkit/glue/webscriptsource.h" class WebDataSource; class WebError; @@ -26,6 +24,11 @@ class Rect; class Size; } +namespace WebKit { +struct WebFindInPageRequest; +struct WebScriptSource; +} + // Every frame in a web page is represented by one WebFrame, including the // outermost frame. class WebFrame { @@ -91,14 +94,14 @@ class WebFrame { const GURL& fake_url) = 0; // Executes JavaScript in the web frame. - virtual void ExecuteScript(const webkit_glue::WebScriptSource& source) = 0; + virtual void ExecuteScript(const WebKit::WebScriptSource& source) = 0; // Executes JavaScript in a new context associated with the web frame. The // script gets its own global scope and its own prototypes for intrinsic // JavaScript objects (String, Array, and so-on). It shares the wrappers for // all DOM nodes and DOM constructors. virtual void ExecuteScriptInNewContext( - const webkit_glue::WebScriptSource* sources, int num_sources) = 0; + const WebKit::WebScriptSource* sources, int num_sources) = 0; // Inserts the given CSS styles at the beginning of the document. virtual bool InsertCSSStyles(const std::string& css) = 0; @@ -212,7 +215,7 @@ class WebFrame { // If no match is found, this function clears all tickmarks and highlighting. // // Returns true if the search string was found, false otherwise. - virtual bool Find(const FindInPageRequest& request, + virtual bool Find(const WebKit::WebFindInPageRequest& request, bool wrap_within_frame, gfx::Rect* selection_rect) = 0; @@ -235,7 +238,7 @@ class WebFrame { // cancel at any time (see CancelPendingScopingEffort). The parameter Request // specifies what to look for and Reset signals whether this is a brand new // request or a continuation of the last scoping effort. - virtual void ScopeStringMatches(FindInPageRequest request, + virtual void ScopeStringMatches(const WebKit::WebFindInPageRequest& request, bool reset) = 0; // Cancels any outstanding requests for scoping string matches on a frame. diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 099d92c..d33b45f 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -135,6 +135,8 @@ MSVC_POP_WARNING(); #include "net/base/net_errors.h" #include "skia/ext/bitmap_platform_device.h" #include "skia/ext/platform_canvas.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFindInPageRequest.h" +#include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h" #include "webkit/glue/alt_error_page_resource_fetcher.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/dom_operations_private.h" @@ -191,6 +193,8 @@ using WebCore::SubstituteData; using WebCore::TextIterator; using WebCore::VisiblePosition; using WebCore::XPathResult; +using WebKit::WebFindInPageRequest; +using WebKit::WebScriptSource; // Key for a StatsCounter tracking how many WebFrames are active. static const char* const kWebFrameActiveCount = "WebFrameActiveCount"; @@ -932,16 +936,16 @@ void WebFrameImpl::ResetMatchCount() { frames_scoping_count_ = 0; } -bool WebFrameImpl::Find(const FindInPageRequest& request, +bool WebFrameImpl::Find(const WebFindInPageRequest& request, bool wrap_within_frame, gfx::Rect* selection_rect) { WebCore::String webcore_string = - webkit_glue::String16ToString(request.search_string); + webkit_glue::WebStringToString(request.text); WebFrameImpl* const main_frame_impl = static_cast<WebFrameImpl*>(GetView()->GetMainFrame()); - if (!request.find_next) + if (!request.findNext) frame()->page()->unmarkAllTextMatches(); // Starts the search from the current selection. @@ -949,7 +953,7 @@ bool WebFrameImpl::Find(const FindInPageRequest& request, DCHECK(frame() && frame()->view()); bool found = frame()->findString(webcore_string, request.forward, - request.match_case, wrap_within_frame, + request.matchCase, wrap_within_frame, start_in_selection); if (found) { #if defined(OS_WIN) @@ -978,7 +982,7 @@ bool WebFrameImpl::Find(const FindInPageRequest& request, curr_selection_rect = active_match_->boundingBox(); } - if (!request.find_next) { + if (!request.findNext) { // This is a Find operation, so we set the flag to ask the scoping effort // to find the active rect for us so we can update the ordinal (n of m). locating_active_rect_ = true; @@ -1011,7 +1015,7 @@ bool WebFrameImpl::Find(const FindInPageRequest& request, ReportFindInPageSelection(rect, active_match_index_ + 1, - request.request_id); + request.identifier); } #endif } @@ -1043,7 +1047,7 @@ int WebFrameImpl::OrdinalOfFirstMatchForFrame(WebFrameImpl* frame) const { return ordinal; } -bool WebFrameImpl::ShouldScopeMatches(FindInPageRequest request) { +bool WebFrameImpl::ShouldScopeMatches(const WebFindInPageRequest& request) { // Don't scope if we can't find a frame or if the frame is not visible. // The user may have closed the tab/application, so abort. if (!frame() || !Visible()) @@ -1058,7 +1062,7 @@ bool WebFrameImpl::ShouldScopeMatches(FindInPageRequest request) { !last_search_string_.empty() && last_match_count_ == 0) { // Check to see if the search string prefixes match. string16 previous_search_prefix = - request.search_string.substr(0, last_search_string_.length()); + string16(request.text).substr(0, last_search_string_.length()); if (previous_search_prefix == last_search_string_) { return false; // Don't search this frame, it will be fruitless. @@ -1119,7 +1123,7 @@ void WebFrameImpl::AddMarker(WebCore::Range* range) { } } -void WebFrameImpl::ScopeStringMatches(FindInPageRequest request, +void WebFrameImpl::ScopeStringMatches(const WebFindInPageRequest& request, bool reset) { if (!ShouldScopeMatches(request)) return; @@ -1152,7 +1156,7 @@ void WebFrameImpl::ScopeStringMatches(FindInPageRequest request, } WebCore::String webcore_string = - webkit_glue::String16ToString(request.search_string); + webkit_glue::WebStringToString(request.text); RefPtr<Range> search_range(rangeOfContents(frame()->document())); @@ -1187,7 +1191,7 @@ void WebFrameImpl::ScopeStringMatches(FindInPageRequest request, RefPtr<Range> result_range(findPlainText(search_range.get(), webcore_string, true, - request.match_case)); + request.matchCase)); if (result_range->collapsed(ec)) { if (!result_range->startContainer()->isInShadowTree()) break; @@ -1251,7 +1255,7 @@ void WebFrameImpl::ScopeStringMatches(FindInPageRequest request, webkit_glue::FromIntRect( frame()->view()->convertToContainingWindow(result_bounds)), active_match_index_ + 1, - request.request_id); + request.identifier); #endif } } @@ -1262,7 +1266,7 @@ void WebFrameImpl::ScopeStringMatches(FindInPageRequest request, // Remember what we search for last time, so we can skip searching if more // letters are added to the search string (and last outcome was 0). - last_search_string_ = request.search_string; + last_search_string_ = request.text; if (match_count > 0) { frame()->setMarkedTextMatchesAreHighlighted(true); @@ -1270,7 +1274,7 @@ void WebFrameImpl::ScopeStringMatches(FindInPageRequest request, last_match_count_ += match_count; // Let the mainframe know how much we found during this pass. - main_frame_impl->IncreaseMatchCount(match_count, request.request_id); + main_frame_impl->IncreaseMatchCount(match_count, request.identifier); } if (timeout) { @@ -1298,7 +1302,7 @@ void WebFrameImpl::ScopeStringMatches(FindInPageRequest request, // If this is the last frame to finish scoping we need to trigger the final // update to be sent. if (main_frame_impl->frames_scoping_count_ == 0) - main_frame_impl->IncreaseMatchCount(0, request.request_id); + main_frame_impl->IncreaseMatchCount(0, request.identifier); // This frame is done, so show any scrollbar tickmarks we haven't drawn yet. InvalidateArea(INVALIDATE_SCROLLBAR); @@ -1695,12 +1699,12 @@ void WebFrameImpl::LoadAlternateHTMLErrorPage(const WebRequest* request, error_page_url)); } -void WebFrameImpl::ExecuteScript(const webkit_glue::WebScriptSource& source) { +void WebFrameImpl::ExecuteScript(const WebScriptSource& source) { frame_->loader()->executeScript( WebCore::ScriptSourceCode( - webkit_glue::StdStringToString(source.source), - webkit_glue::GURLToKURL(source.url), - source.start_line)); + webkit_glue::WebStringToString(source.code), + webkit_glue::WebURLToKURL(source.url), + source.startLine)); } bool WebFrameImpl::InsertCSSStyles(const std::string& css) { @@ -1723,14 +1727,14 @@ bool WebFrameImpl::InsertCSSStyles(const std::string& css) { } void WebFrameImpl::ExecuteScriptInNewContext( - const webkit_glue::WebScriptSource* sources_in, int num_sources) { + const WebScriptSource* sources_in, int num_sources) { Vector<WebCore::ScriptSourceCode> sources; for (int i = 0; i < num_sources; ++i) { sources.append(WebCore::ScriptSourceCode( - webkit_glue::StdStringToString(sources_in[i].source), - webkit_glue::GURLToKURL(sources_in[i].url), - sources_in[i].start_line)); + webkit_glue::WebStringToString(sources_in[i].code), + webkit_glue::WebURLToKURL(sources_in[i].url), + sources_in[i].startLine)); } frame_->script()->evaluateInNewContext(sources); diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h index 004c5ad..ec622c4 100644 --- a/webkit/glue/webframe_impl.h +++ b/webkit/glue/webframe_impl.h @@ -91,9 +91,9 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { const GURL& error_page_url, bool replace, const GURL& fake_url); - virtual void ExecuteScript(const webkit_glue::WebScriptSource& source); + virtual void ExecuteScript(const WebKit::WebScriptSource& source); virtual void ExecuteScriptInNewContext( - const webkit_glue::WebScriptSource* sources, int num_sources); + const WebKit::WebScriptSource* sources, int num_sources); virtual bool InsertCSSStyles(const std::string& css); virtual bool GetPreviousHistoryState(std::string* history_state) const; virtual bool GetCurrentHistoryState(std::string* history_state) const; @@ -124,11 +124,12 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { virtual NPObject* GetWindowNPObject(); virtual void GetContentAsPlainText(int max_chars, std::wstring* text) const; - virtual bool Find(const FindInPageRequest& request, - bool wrap_within_frame, - gfx::Rect* selection_rect); + virtual bool Find( + const WebKit::WebFindInPageRequest& request, bool wrap_within_frame, + gfx::Rect* selection_rect); virtual void StopFinding(bool clear_selection); - virtual void ScopeStringMatches(FindInPageRequest request, bool reset); + virtual void ScopeStringMatches( + const WebKit::WebFindInPageRequest& request, bool reset); virtual void CancelPendingScopingEffort(); virtual void ResetMatchCount(); virtual bool Visible(); @@ -386,7 +387,7 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { // It is not necessary if the frame is invisible, for example, or if this // is a repeat search that already returned nothing last time the same prefix // was searched. - bool ShouldScopeMatches(FindInPageRequest request); + bool ShouldScopeMatches(const WebKit::WebFindInPageRequest& request); // Only for test_shell int PendingFrameUnloadEventCount() const; diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index 3362c03..409ee0e 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -254,6 +254,11 @@ bool DecodeImage(const std::string& image_data, SkBitmap* image) { return false; } +// NOTE: This pair of conversion functions are here instead of in glue_util.cc +// since that file will eventually die. This pair of functions will need to +// remain as the concept of a file-path specific character encoding string type +// will most likely not make its way into WebKit. + FilePath::StringType WebStringToFilePathString(const WebKit::WebString& str) { #if defined(OS_POSIX) return base::SysWideToNativeMB(UTF16ToWideHack(str)); diff --git a/webkit/glue/webscriptsource.h b/webkit/glue/webscriptsource.h deleted file mode 100644 index 5f9fd23..0000000 --- a/webkit/glue/webscriptsource.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2006-2009 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_WEBSCRIPT_SOURCE_H_ -#define WEBKIT_GLUE_WEBSCRIPT_SOURCE_H_ - -namespace webkit_glue { - -// Describes some script that can be executed within a frame. -// NOTE: start_line is 1-based (like the corresponding object in WebCore). -// TODO(aa): Allow clients to specify external data intead of strings to avoid -// copies. -struct WebScriptSource { - WebScriptSource(const std::string& source) - : source(source), start_line(1) {} - WebScriptSource(const std::string& source, const GURL& url) - : source(source), url(url), start_line(1) {} - WebScriptSource(const std::string& source, const GURL& url, int start_line) - : source(source), url(url), start_line(start_line) {} - - std::string source; - GURL url; - int start_line; -}; - -} // namespace webkit_glue - -#endif // WEBKIT_GLUE_WEBSCRIPT_SOURCE_H_ diff --git a/webkit/tools/test_shell/plugin_tests.cc b/webkit/tools/test_shell/plugin_tests.cc index e672c7b..64824e4 100644 --- a/webkit/tools/test_shell/plugin_tests.cc +++ b/webkit/tools/test_shell/plugin_tests.cc @@ -8,12 +8,14 @@ #include "base/path_service.h" #include "base/string_util.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h" #include "webkit/glue/webframe.h" -#include "webkit/glue/webscriptsource.h" #include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_shell.h" #include "webkit/tools/test_shell/test_shell_test.h" +using WebKit::WebScriptSource; +using WebKit::WebString; // Provides functionality for creating plugin tests. class PluginTest : public TestShellTest { @@ -69,8 +71,10 @@ TEST_F(PluginTest, DISABLED_Refresh) { test_shell_->WaitTestFinished(); std::wstring text; - webkit_glue::WebScriptSource call_check("check();"); - webkit_glue::WebScriptSource refresh("navigator.plugins.refresh(false)"); + WebScriptSource call_check( + WebString::fromUTF8("check();")); + WebScriptSource refresh( + WebString::fromUTF8("navigator.plugins.refresh(false)")); test_shell_->webView()->GetMainFrame()->ExecuteScript(call_check); test_shell_->webView()->GetMainFrame()->GetContentAsPlainText(10000, &text); diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index 72f2ec8..b57e75a 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -4108,12 +4108,14 @@ '../third_party/WebKit/WebKit/chromium/public/WebCString.h', '../third_party/WebKit/WebKit/chromium/public/WebClipboard.h', '../third_party/WebKit/WebKit/chromium/public/WebCommon.h', + '../third_party/WebKit/WebKit/chromium/public/WebFindInPageRequest.h', '../third_party/WebKit/WebKit/chromium/public/WebImage.h', '../third_party/WebKit/WebKit/chromium/public/WebKit.h', '../third_party/WebKit/WebKit/chromium/public/WebKitClient.h', '../third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h', '../third_party/WebKit/WebKit/chromium/public/WebPoint.h', '../third_party/WebKit/WebKit/chromium/public/WebRect.h', + '../third_party/WebKit/WebKit/chromium/public/WebScriptSource.h', '../third_party/WebKit/WebKit/chromium/public/WebSize.h', '../third_party/WebKit/WebKit/chromium/public/WebString.h', '../third_party/WebKit/WebKit/chromium/public/WebURL.h', @@ -4315,7 +4317,6 @@ 'glue/event_conversion.h', 'glue/feed_preview.cc', 'glue/feed_preview.h', - 'glue/find_in_page_request.h', 'glue/form_data.h', 'glue/glue_accessibility.cc', 'glue/glue_serialize.cc', @@ -4403,7 +4404,6 @@ 'glue/webplugin_impl.cc', 'glue/webplugin_impl.h', 'glue/webpreferences.h', - 'glue/webscriptsource.h', 'glue/webresponse.h', 'glue/webresponse_impl.h', 'glue/webtextinput.h', |