diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-12 00:26:22 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-12 00:26:22 +0000 |
commit | 9058042d9d4ad27e76b09caee3d944a25b22e0ff (patch) | |
tree | a05c39bad2fd72a09071b19090e8a6218d052654 | |
parent | 9d2eae83f7202da680b9b944ff27b7559ac2a6e7 (diff) | |
download | chromium_src-9058042d9d4ad27e76b09caee3d944a25b22e0ff.zip chromium_src-9058042d9d4ad27e76b09caee3d944a25b22e0ff.tar.gz chromium_src-9058042d9d4ad27e76b09caee3d944a25b22e0ff.tar.bz2 |
content/GTK: Move TabContentsViewGtk to content/
BUG=93804
TEST=compiles
TBR=beng
Review URL: http://codereview.chromium.org/9185025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117335 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chrome_content_browser_client.cc | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.cc | 5 | ||||
-rw-r--r-- | chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h | 11 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/constrained_window_gtk.cc | 12 | ||||
-rw-r--r-- | chrome/browser/ui/login/login_prompt_gtk.cc | 3 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 3 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents_view_gtk.cc (renamed from chrome/browser/tab_contents/tab_contents_view_gtk.cc) | 13 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents_view_gtk.h (renamed from chrome/browser/tab_contents/tab_contents_view_gtk.h) | 24 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents_view_wrapper_gtk.h (renamed from chrome/browser/tab_contents/tab_contents_view_wrapper_gtk.h) | 18 | ||||
-rw-r--r-- | content/content_browser.gypi | 3 |
10 files changed, 56 insertions, 42 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index e3c2be4..102d6e7 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -125,7 +125,7 @@ #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" #elif defined(TOOLKIT_USES_GTK) #include "chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h" -#include "chrome/browser/tab_contents/tab_contents_view_gtk.h" +#include "content/browser/tab_contents/tab_contents_view_gtk.h" #elif defined(OS_MACOSX) #include "chrome/browser/tab_contents/tab_contents_view_mac.h" #endif @@ -312,8 +312,8 @@ TabContentsView* ChromeContentBrowserClient::CreateTabContentsView( #if defined(TOOLKIT_VIEWS) return new TabContentsViewViews(tab_contents); #elif defined(TOOLKIT_USES_GTK) - return new TabContentsViewGtk(tab_contents, - new ChromeTabContentsViewWrapperGtk); + return new content::TabContentsViewGtk(tab_contents, + new ChromeTabContentsViewWrapperGtk); #elif defined(OS_MACOSX) return tab_contents_view_mac::CreateTabContentsView(tab_contents); #else diff --git a/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.cc b/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.cc index e6e5115..8b2960d 100644 --- a/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.cc +++ b/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.cc @@ -6,12 +6,12 @@ #include "chrome/browser/browser_shutdown.h" #include "chrome/browser/tab_contents/render_view_context_menu_gtk.h" -#include "chrome/browser/tab_contents/tab_contents_view_gtk.h" #include "chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.h" #include "chrome/browser/ui/gtk/constrained_window_gtk.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view_gtk.h" #include "content/browser/tab_contents/interstitial_page.h" +#include "content/browser/tab_contents/tab_contents_view_gtk.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" #include "ui/base/gtk/gtk_floating_container.h" @@ -47,7 +47,8 @@ void ChromeTabContentsViewWrapperGtk::RemoveConstrainedWindow( constrained_window->widget()); } -void ChromeTabContentsViewWrapperGtk::WrapView(TabContentsViewGtk* view) { +void ChromeTabContentsViewWrapperGtk::WrapView( + content::TabContentsViewGtk* view) { view_ = view; gtk_container_add(GTK_CONTAINER(floating_.get()), diff --git a/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h b/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h index 99f6475..87ea5ac 100644 --- a/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h +++ b/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -8,7 +8,7 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" -#include "chrome/browser/tab_contents/tab_contents_view_wrapper_gtk.h" +#include "content/browser/tab_contents/tab_contents_view_wrapper_gtk.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/base/gtk/owned_widget_gtk.h" @@ -19,7 +19,8 @@ class WebDragBookmarkHandlerGtk; // A chrome/ specific class that extends TabContentsViewGtk with features like // constrained windows, which live in chrome/. -class ChromeTabContentsViewWrapperGtk : public TabContentsViewWrapperGtk { +class ChromeTabContentsViewWrapperGtk + : public content::TabContentsViewWrapperGtk { public: ChromeTabContentsViewWrapperGtk(); virtual ~ChromeTabContentsViewWrapperGtk(); @@ -30,7 +31,7 @@ class ChromeTabContentsViewWrapperGtk : public TabContentsViewWrapperGtk { void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); // Overridden from TabContentsViewGtkWrapper: - virtual void WrapView(TabContentsViewGtk* view) OVERRIDE; + virtual void WrapView(content::TabContentsViewGtk* view) OVERRIDE; virtual gfx::NativeView GetNativeView() const OVERRIDE; virtual void OnCreateViewForWidget() OVERRIDE; virtual void Focus() OVERRIDE; @@ -49,7 +50,7 @@ class ChromeTabContentsViewWrapperGtk : public TabContentsViewWrapperGtk { ui::OwnedWidgetGtk floating_; // Our owner. Also owns our child widgets. - TabContentsViewGtk* view_; + content::TabContentsViewGtk* view_; // The UI for the constrained dialog currently displayed. This is owned by // TabContents, not the view. diff --git a/chrome/browser/ui/gtk/constrained_window_gtk.cc b/chrome/browser/ui/gtk/constrained_window_gtk.cc index 570a4539e..5fc3b10 100644 --- a/chrome/browser/ui/gtk/constrained_window_gtk.cc +++ b/chrome/browser/ui/gtk/constrained_window_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -22,7 +22,7 @@ #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" #else #include "chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h" -#include "chrome/browser/tab_contents/tab_contents_view_gtk.h" +#include "content/browser/tab_contents/tab_contents_view_gtk.h" #endif using content::BrowserThread; @@ -126,8 +126,8 @@ void ConstrainedWindowGtk::FocusConstrainedWindow() { // TODO(estade): this define should not need to be here because this class // should not be used on linux/views. #if defined(TOOLKIT_GTK) - static_cast<TabContentsViewGtk*>(wrapper_->web_contents()->GetView())-> - SetFocusedWidget(focus_widget); + static_cast<content::TabContentsViewGtk*>( + wrapper_->web_contents()->GetView())->SetFocusedWidget(focus_widget); #endif } } @@ -140,8 +140,8 @@ ConstrainedWindowGtk::TabContentsViewType* native_tab_contents_view()); #else return static_cast<TabContentsViewType*>( - static_cast<TabContentsViewGtk*>(wrapper_->web_contents()->GetView())-> - wrapper()); + static_cast<content::TabContentsViewGtk*>( + wrapper_->web_contents()->GetView())->wrapper()); #endif } diff --git a/chrome/browser/ui/login/login_prompt_gtk.cc b/chrome/browser/ui/login/login_prompt_gtk.cc index 5e34e4f..6ec0851 100644 --- a/chrome/browser/ui/login/login_prompt_gtk.cc +++ b/chrome/browser/ui/login/login_prompt_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -9,7 +9,6 @@ #include "base/string16.h" #include "base/utf_string_conversions.h" #include "chrome/browser/password_manager/password_manager.h" -#include "chrome/browser/tab_contents/tab_contents_view_gtk.h" #include "chrome/browser/tab_contents/tab_util.h" #include "chrome/browser/ui/gtk/constrained_window_gtk.h" #include "chrome/browser/ui/gtk/gtk_util.h" diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index e5b3725..dee8c30 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2368,11 +2368,8 @@ 'browser/tab_contents/retargeting_details.h', 'browser/tab_contents/tab_contents_ssl_helper.cc', 'browser/tab_contents/tab_contents_ssl_helper.h', - 'browser/tab_contents/tab_contents_view_gtk.cc', - 'browser/tab_contents/tab_contents_view_gtk.h', 'browser/tab_contents/tab_contents_view_mac.h', 'browser/tab_contents/tab_contents_view_mac.mm', - 'browser/tab_contents/tab_contents_view_wrapper_gtk.h', 'browser/tab_contents/tab_util.cc', 'browser/tab_contents/tab_util.h', 'browser/tab_contents/thumbnail_generator.cc', diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/content/browser/tab_contents/tab_contents_view_gtk.cc index 08d0463..ed87863 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc +++ b/content/browser/tab_contents/tab_contents_view_gtk.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/tab_contents/tab_contents_view_gtk.h" +#include "content/browser/tab_contents/tab_contents_view_gtk.h" #include <gdk/gdk.h> #include <gdk/gdkkeysyms.h> @@ -13,12 +13,12 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "build/build_config.h" -#include "chrome/browser/tab_contents/tab_contents_view_wrapper_gtk.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_view_host_factory.h" #include "content/browser/renderer_host/render_widget_host_view_gtk.h" #include "content/browser/tab_contents/interstitial_page.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/tab_contents/tab_contents_view_wrapper_gtk.h" #include "content/browser/tab_contents/web_drag_dest_gtk.h" #include "content/browser/tab_contents/web_drag_source_gtk.h" #include "content/public/browser/web_contents_delegate.h" @@ -75,8 +75,11 @@ gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event, } // namespace -TabContentsViewGtk::TabContentsViewGtk(TabContents* tab_contents, - TabContentsViewWrapperGtk* view_wrapper) +namespace content { + +TabContentsViewGtk::TabContentsViewGtk( + TabContents* tab_contents, + content::TabContentsViewWrapperGtk* view_wrapper) : tab_contents_(tab_contents), expanded_(gtk_expanded_container_new()), view_wrapper_(view_wrapper), @@ -438,3 +441,5 @@ void TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget, if (tab_contents_->GetInterstitialPage()) tab_contents_->GetInterstitialPage()->SetSize(size); } + +} // namespace content diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.h b/content/browser/tab_contents/tab_contents_view_gtk.h index 5856d24..bafaa8d 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.h +++ b/content/browser/tab_contents/tab_contents_view_gtk.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ -#define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ +#ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ +#define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ #pragma once #include <gtk/gtk.h> @@ -13,19 +13,19 @@ #include "base/memory/scoped_ptr.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/browser/tab_contents/tab_contents_view_helper.h" +#include "content/common/content_export.h" #include "ui/base/gtk/focus_store_gtk.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/base/gtk/owned_widget_gtk.h" namespace content { + +class TabContentsViewWrapperGtk; class WebDragDestDelegate; class WebDragDestGtk; class WebDragSourceGtk; -} -class TabContentsViewWrapperGtk; - -class TabContentsViewGtk : public TabContentsView { +class CONTENT_EXPORT TabContentsViewGtk : public TabContentsView { public: // The corresponding TabContents is passed in the constructor, and manages // our lifetime. This doesn't need to be the case, but is this way currently @@ -43,10 +43,10 @@ class TabContentsViewGtk : public TabContentsView { TabContentsViewWrapperGtk* wrapper() const { return view_wrapper_.get(); } TabContents* tab_contents() { return tab_contents_; } GtkWidget* expanded_container() { return expanded_.get(); } - content::WebContents* web_contents(); + WebContents* web_contents(); // Allows our embeder to intercept incoming drag messages. - void SetDragDestDelegate(content::WebDragDestDelegate* delegate); + void SetDragDestDelegate(WebDragDestDelegate* delegate); // TabContentsView implementation -------------------------------------------- @@ -139,10 +139,10 @@ class TabContentsViewGtk : public TabContentsView { // The helper object that handles drag destination related interactions with // GTK. - scoped_ptr<content::WebDragDestGtk> drag_dest_; + scoped_ptr<WebDragDestGtk> drag_dest_; // Object responsible for handling drags from the page for us. - scoped_ptr<content::WebDragSourceGtk> drag_source_; + scoped_ptr<WebDragSourceGtk> drag_source_; // Our optional views wrapper. If non-NULL, we return this widget as our // GetNativeView() and insert |expanded_| as its child in the GtkWidget @@ -160,4 +160,6 @@ class TabContentsViewGtk : public TabContentsView { DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); }; -#endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ +} // namespace content + +#endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ diff --git a/chrome/browser/tab_contents/tab_contents_view_wrapper_gtk.h b/content/browser/tab_contents/tab_contents_view_wrapper_gtk.h index 02ad233..0738052 100644 --- a/chrome/browser/tab_contents/tab_contents_view_wrapper_gtk.h +++ b/content/browser/tab_contents/tab_contents_view_wrapper_gtk.h @@ -1,22 +1,26 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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 CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WRAPPER_GTK_H_ -#define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WRAPPER_GTK_H_ +#ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WRAPPER_GTK_H_ +#define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WRAPPER_GTK_H_ #pragma once #include <gtk/gtk.h> +#include "content/common/content_export.h" #include "ui/gfx/native_widget_types.h" -class TabContentsViewGtk; struct ContextMenuParams; +namespace content { + +class TabContentsViewGtk; + // An object that supplies the Gtk parent of TabContentsViewGtk. Embedders may // want to insert widgets that provide features that live with the // TabContentsViewGtk. -class TabContentsViewWrapperGtk { +class CONTENT_EXPORT TabContentsViewWrapperGtk { public: // Initializes the TabContentsViewGtkWrapper by taking |view| and adding it // this object's GtkContainer. @@ -48,4 +52,6 @@ class TabContentsViewWrapperGtk { virtual ~TabContentsViewWrapperGtk() {} }; -#endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WRAPPER_GTK_H_ +} // namespace content + +#endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WRAPPER_GTK_H_ diff --git a/content/content_browser.gypi b/content/content_browser.gypi index f667729..b26ad31 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -614,8 +614,11 @@ 'browser/tab_contents/tab_contents.h', 'browser/tab_contents/tab_contents_view.cc', 'browser/tab_contents/tab_contents_view.h', + 'browser/tab_contents/tab_contents_view_gtk.cc', + 'browser/tab_contents/tab_contents_view_gtk.h', 'browser/tab_contents/tab_contents_view_helper.cc', 'browser/tab_contents/tab_contents_view_helper.h', + 'browser/tab_contents/tab_contents_view_wrapper_gtk.h', 'browser/tab_contents/title_updated_details.h', 'browser/tab_contents/web_drag_dest_delegate.h', 'browser/tab_contents/web_drag_dest_gtk.cc', |