diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 21:50:41 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 21:50:41 +0000 |
commit | 5590f8286b568b29e67f0d575dad0cb84f071e87 (patch) | |
tree | 76a5cc4ce0cdb148a3a4d258104e1f249878bc91 /webkit/tools | |
parent | 35a61135047d83c9b87fdb57f86367c05efeeb26 (diff) | |
download | chromium_src-5590f8286b568b29e67f0d575dad0cb84f071e87.zip chromium_src-5590f8286b568b29e67f0d575dad0cb84f071e87.tar.gz chromium_src-5590f8286b568b29e67f0d575dad0cb84f071e87.tar.bz2 |
Rename ViewHandle to NativeView et al.
ViewHandle is a very unfortunate name when we actually start dealing with
views, so we are renaming the cross-platform typedefs to make it clear
that they refer to platform specific native UI elements.
Review URL: http://codereview.chromium.org/13754
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6826 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.h | 22 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_gtk.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_mac.mm | 8 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_win.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate_gtk.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/webview_host.h | 6 | ||||
-rw-r--r-- | webkit/tools/test_shell/webview_host_win.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host.h | 16 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_gtk.cc | 6 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_win.cc | 4 |
14 files changed, 41 insertions, 41 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 79494b2..96a7865 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -374,7 +374,7 @@ void LayoutTestController::Reset() { // shell. We don't want to delete elements as we're iterating, so we copy // to a temp vector first. WindowList* windows = TestShell::windowList(); - std::vector<gfx::WindowHandle> windows_to_delete; + std::vector<gfx::NativeWindow> windows_to_delete; for (WindowList::iterator i = windows->begin(); i != windows->end(); ++i) { if (*i != shell_->mainWnd()) windows_to_delete.push_back(*i); diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 7679265..e661066 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -300,7 +300,7 @@ void TestShell::ResetWebPreferences() { } // static -bool TestShell::RemoveWindowFromList(gfx::WindowHandle window) { +bool TestShell::RemoveWindowFromList(gfx::NativeWindow window) { WindowList::iterator entry = std::find(TestShell::windowList()->begin(), TestShell::windowList()->end(), diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h index ef9de09..5e6a8da 100644 --- a/webkit/tools/test_shell/test_shell.h +++ b/webkit/tools/test_shell/test_shell.h @@ -45,7 +45,7 @@ #include "webkit/tools/test_shell/webview_host.h" #include "webkit/tools/test_shell/webwidget_host.h" -typedef std::list<gfx::WindowHandle> WindowList; +typedef std::list<gfx::NativeWindow> WindowList; struct WebPreferences; class TestNavigationEntry; @@ -162,10 +162,10 @@ public: void DumpDocumentText(); void DumpRenderTree(); - gfx::WindowHandle mainWnd() const { return m_mainWnd; } - gfx::ViewHandle webViewWnd() const { return m_webViewHost->view_handle(); } - gfx::EditViewHandle editWnd() const { return m_editWnd; } - gfx::ViewHandle popupWnd() const { return m_popupHost->view_handle(); } + gfx::NativeWindow mainWnd() const { return m_mainWnd; } + gfx::NativeView webViewWnd() const { return m_webViewHost->view_handle(); } + gfx::NativeEditView editWnd() const { return m_editWnd; } + gfx::NativeView popupWnd() const { return m_popupHost->view_handle(); } static WindowList* windowList() { return window_list_; } @@ -173,11 +173,11 @@ public: static bool CreateNewWindow(const std::wstring& startingURL, TestShell** shell = NULL); - static void DestroyWindow(gfx::WindowHandle windowHandle); + static void DestroyWindow(gfx::NativeWindow windowHandle); // Remove the given window from window_list_, return true if it was in the // list and was removed and false otherwise. - static bool RemoveWindowFromList(gfx::WindowHandle window); + static bool RemoveWindowFromList(gfx::NativeWindow window); // Implements CreateWebView for TestWebViewDelegate, which in turn // is called as a WebViewDelegate. @@ -246,7 +246,7 @@ public: #if defined(OS_MACOSX) // handle cleaning up a shell given the associated window - static void DestroyAssociatedShell(gfx::WindowHandle handle); + static void DestroyAssociatedShell(gfx::NativeWindow handle); #endif // Show the "attach to me" dialog, for debugging test shell startup. @@ -272,8 +272,8 @@ protected: #endif protected: - gfx::WindowHandle m_mainWnd; - gfx::EditViewHandle m_editWnd; + gfx::NativeWindow m_mainWnd; + gfx::NativeEditView m_editWnd; scoped_ptr<WebViewHost> m_webViewHost; WebWidgetHost* m_popupHost; #if defined(OS_WIN) @@ -287,7 +287,7 @@ private: // A set of all our windows. static WindowList* window_list_; #if defined(OS_MACOSX) - static base::LazyInstance<std::map<gfx::WindowHandle, TestShell *> > + static base::LazyInstance<std::map<gfx::NativeWindow, TestShell *> > window_map_; #endif diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc index 35b4e69..ba2c405 100644 --- a/webkit/tools/test_shell/test_shell_gtk.cc +++ b/webkit/tools/test_shell/test_shell_gtk.cc @@ -308,7 +308,7 @@ void TestShell::InteractiveSetFocus(WebWidgetHost* host, bool enable) { } } -void TestShell::DestroyWindow(gfx::WindowHandle windowHandle) { +void TestShell::DestroyWindow(gfx::NativeWindow windowHandle) { RemoveWindowFromList(windowHandle); gtk_widget_destroy(windowHandle); } @@ -719,7 +719,7 @@ bool GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { return false; } -ScreenInfo GetScreenInfo(gfx::ViewHandle window) { +ScreenInfo GetScreenInfo(gfx::NativeView window) { return GetScreenInfoHelper(window); } diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm index 403f1f0..bf6ca2a 100644 --- a/webkit/tools/test_shell/test_shell_mac.mm +++ b/webkit/tools/test_shell/test_shell_mac.mm @@ -59,7 +59,7 @@ const int kTestWindowXLocation = -14000; const int kTestWindowYLocation = -14000; // Define static member variables -base::LazyInstance <std::map<gfx::WindowHandle, TestShell *> > +base::LazyInstance <std::map<gfx::NativeWindow, TestShell *> > TestShell::window_map_(base::LINKER_INITIALIZED); // Receives notification that the window is closing so that it can start the @@ -107,7 +107,7 @@ void TestShell::PlatformCleanUp() { } // static -void TestShell::DestroyAssociatedShell(gfx::WindowHandle handle) { +void TestShell::DestroyAssociatedShell(gfx::NativeWindow handle) { TestShell* shell = window_map_.Get()[handle]; if (shell) window_map_.Get().erase(handle); @@ -407,7 +407,7 @@ bool TestShell::CreateNewWindow(const std::wstring& startingURL, } // static -void TestShell::DestroyWindow(gfx::WindowHandle windowHandle) { +void TestShell::DestroyWindow(gfx::NativeWindow windowHandle) { TestShell::RemoveWindowFromList(windowHandle); [windowHandle close]; } @@ -690,7 +690,7 @@ bool GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { return false; // NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins); } -ScreenInfo GetScreenInfo(gfx::ViewHandle window) { +ScreenInfo GetScreenInfo(gfx::NativeView window) { // This should call GetScreenInfoHelper, which should be implemented in // webkit_glue_mac.mm NOTIMPLEMENTED(); diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc index 787ac1a..b8c1870 100644 --- a/webkit/tools/test_shell/test_shell_win.cc +++ b/webkit/tools/test_shell/test_shell_win.cc @@ -167,7 +167,7 @@ bool TestShell::CreateNewWindow(const std::wstring& startingURL, return rv; } -void TestShell::DestroyWindow(gfx::WindowHandle windowHandle) { +void TestShell::DestroyWindow(gfx::NativeWindow windowHandle) { // Do we want to tear down some of the machinery behind the scenes too? RemoveWindowFromList(windowHandle); ::DestroyWindow(windowHandle); @@ -768,7 +768,7 @@ bool DownloadUrl(const std::string& url, HWND caller_window) { return false; } -ScreenInfo GetScreenInfo(gfx::ViewHandle window) { +ScreenInfo GetScreenInfo(gfx::NativeView window) { return GetScreenInfoHelper(window); } diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 19354f6..9e79b30 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -634,7 +634,7 @@ void TestWebViewDelegate::SetUserStyleSheetLocation(const GURL& location) { // WebWidgetDelegate --------------------------------------------------------- -gfx::ViewHandle TestWebViewDelegate::GetContainingWindow(WebWidget* webwidget) { +gfx::NativeView TestWebViewDelegate::GetContainingWindow(WebWidget* webwidget) { if (WebWidgetHost* host = GetHostForWidget(webwidget)) return host->view_handle(); diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index febbefa..c559b1e 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -206,7 +206,7 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, virtual int GetHistoryForwardListCount(); // WebWidgetDelegate - virtual gfx::ViewHandle GetContainingWindow(WebWidget* webwidget); + virtual gfx::NativeView GetContainingWindow(WebWidget* webwidget); virtual void DidInvalidateRect(WebWidget* webwidget, const gfx::Rect& rect); virtual void DidScrollRect(WebWidget* webwidget, int dx, int dy, const gfx::Rect& clip_rect); diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc index 3b0bf82..6db73b4 100644 --- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc +++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc @@ -82,7 +82,7 @@ WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( } void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) { - // TODO(port): remove GTK_WINDOW bit after gfx::WindowHandle is fixed. + // TODO(port): remove GTK_WINDOW bit after gfx::NativeWindow is fixed. GtkWidget* dialog = gtk_message_dialog_new( GTK_WINDOW(shell_->mainWnd()), GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", WideToUTF8(message).c_str()); diff --git a/webkit/tools/test_shell/webview_host.h b/webkit/tools/test_shell/webview_host.h index 9a1e719..86dba37 100644 --- a/webkit/tools/test_shell/webview_host.h +++ b/webkit/tools/test_shell/webview_host.h @@ -15,13 +15,13 @@ struct WebPreferences; class WebView; class WebViewDelegate; -// This class is a simple ViewHandle-based host for a WebView +// This class is a simple NativeView-based host for a WebView class WebViewHost : public WebWidgetHost { public: - // The new instance is deleted once the associated ViewHandle is destroyed. + // The new instance is deleted once the associated NativeView is destroyed. // The newly created window should be resized after it is created, using the // MoveWindow (or equivalent) function. - static WebViewHost* Create(gfx::WindowHandle parent_window, + static WebViewHost* Create(gfx::NativeWindow parent_window, WebViewDelegate* delegate, const WebPreferences& prefs); diff --git a/webkit/tools/test_shell/webview_host_win.cc b/webkit/tools/test_shell/webview_host_win.cc index 5b13a7b..899ce31 100644 --- a/webkit/tools/test_shell/webview_host_win.cc +++ b/webkit/tools/test_shell/webview_host_win.cc @@ -14,7 +14,7 @@ static const wchar_t kWindowClassName[] = L"WebViewHost"; /*static*/ -WebViewHost* WebViewHost::Create(gfx::WindowHandle parent_window, +WebViewHost* WebViewHost::Create(gfx::NativeWindow parent_window, WebViewDelegate* delegate, const WebPreferences& prefs) { WebViewHost* host = new WebViewHost(); diff --git a/webkit/tools/test_shell/webwidget_host.h b/webkit/tools/test_shell/webwidget_host.h index cb6c3f1..0b4e197 100644 --- a/webkit/tools/test_shell/webwidget_host.h +++ b/webkit/tools/test_shell/webwidget_host.h @@ -18,21 +18,21 @@ namespace gfx { class Size; } -// This class is a simple ViewHandle-based host for a WebWidget +// This class is a simple NativeView-based host for a WebWidget class WebWidgetHost { public: - // The new instance is deleted once the associated ViewHandle is destroyed. + // The new instance is deleted once the associated NativeView is destroyed. // The newly created window should be resized after it is created, using the // MoveWindow (or equivalent) function. - static WebWidgetHost* Create(gfx::WindowHandle parent_window, + static WebWidgetHost* Create(gfx::NativeWindow parent_window, WebWidgetDelegate* delegate); - static WebWidgetHost* FromWindow(gfx::WindowHandle view); + static WebWidgetHost* FromWindow(gfx::NativeWindow view); #if defined(OS_MACOSX) - static void HandleEvent(gfx::WindowHandle window, NSEvent *event); + static void HandleEvent(gfx::NativeWindow window, NSEvent *event); #endif - gfx::ViewHandle view_handle() const { return view_; } + gfx::NativeView view_handle() const { return view_; } WebWidget* webwidget() const { return webwidget_; } void DidInvalidateRect(const gfx::Rect& rect); @@ -83,7 +83,7 @@ class WebWidgetHost { // parent: a GtkBox to pack the new widget at the end of // host: a pointer to a WebWidgetHost (or subclass thereof) // --------------------------------------------------------------------------- - static gfx::WindowHandle CreateWindow(gfx::WindowHandle parent, void* host); + static gfx::NativeWindow CreateWindow(gfx::NativeWindow parent, void* host); void WindowDestroyed(); void Resize(const gfx::Size& size); #endif @@ -98,7 +98,7 @@ class WebWidgetHost { #endif } - gfx::ViewHandle view_; + gfx::NativeView view_; WebWidget* webwidget_; scoped_ptr<gfx::PlatformCanvas> canvas_; diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc index 389fd61..2e525b5 100644 --- a/webkit/tools/test_shell/webwidget_host_gtk.cc +++ b/webkit/tools/test_shell/webwidget_host_gtk.cc @@ -118,7 +118,7 @@ gboolean MouseScrollEvent(GtkWidget* widget, GdkEventScroll* event, // ----------------------------------------------------------------------------- -gfx::WindowHandle WebWidgetHost::CreateWindow(gfx::WindowHandle box, +gfx::NativeWindow WebWidgetHost::CreateWindow(gfx::NativeWindow box, void* host) { GtkWidget* widget = gtk_drawing_area_new(); gtk_box_pack_start(GTK_BOX(box), widget, TRUE, TRUE, 0); @@ -152,7 +152,7 @@ gfx::WindowHandle WebWidgetHost::CreateWindow(gfx::WindowHandle box, return widget; } -WebWidgetHost* WebWidgetHost::Create(gfx::WindowHandle box, +WebWidgetHost* WebWidgetHost::Create(gfx::NativeWindow box, WebWidgetDelegate* delegate) { WebWidgetHost* host = new WebWidgetHost(); host->view_ = CreateWindow(box, host); @@ -185,7 +185,7 @@ void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) { DidInvalidateRect(clip_rect); } -WebWidgetHost* FromWindow(gfx::WindowHandle view) { +WebWidgetHost* FromWindow(gfx::NativeWindow view) { const gpointer p = g_object_get_data(G_OBJECT(view), "webwidgethost"); return (WebWidgetHost* ) p; } diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc index 6783b91..efe4d8b 100644 --- a/webkit/tools/test_shell/webwidget_host_win.cc +++ b/webkit/tools/test_shell/webwidget_host_win.cc @@ -15,7 +15,7 @@ static const wchar_t kWindowClassName[] = L"WebWidgetHost"; /*static*/ -WebWidgetHost* WebWidgetHost::Create(gfx::WindowHandle parent_window, +WebWidgetHost* WebWidgetHost::Create(gfx::NativeWindow parent_window, WebWidgetDelegate* delegate) { WebWidgetHost* host = new WebWidgetHost(); @@ -45,7 +45,7 @@ WebWidgetHost* WebWidgetHost::Create(gfx::WindowHandle parent_window, } /*static*/ -WebWidgetHost* WebWidgetHost::FromWindow(gfx::WindowHandle hwnd) { +WebWidgetHost* WebWidgetHost::FromWindow(gfx::NativeWindow hwnd) { return reinterpret_cast<WebWidgetHost*>(win_util::GetWindowUserData(hwnd)); } |