diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-19 02:52:53 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-19 02:52:53 +0000 |
commit | 6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c (patch) | |
tree | a75584b11b8ef188b4eb3376b9146e063823a916 /chrome/browser/ui/gtk/tabs | |
parent | bf3ee201c1ca5112f7fd173fc4785aa52920c5c0 (diff) | |
download | chromium_src-6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c.zip chromium_src-6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c.tar.gz chromium_src-6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c.tar.bz2 |
Move NotificationObserver, NotificationSource, and NotificationDetails to content/public/browser.
This patch got way bigger than I wanted, but once I moved NotificationDetails, I figured I might as well mvoe the others since they're in the same files. In hindsight, I should have converted a subset of files at a time by leaving a using statement in the header.
BUG=98716
TBR=joi
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106196 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/gtk/tabs')
-rw-r--r-- | chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc | 18 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h | 14 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc | 10 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h | 20 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc | 8 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/tabs/tab_strip_gtk.h | 12 |
6 files changed, 42 insertions, 40 deletions
diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc index 93543f4..76859ff 100644 --- a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc @@ -19,7 +19,7 @@ #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/notification_source.h" +#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" #include "ui/gfx/screen.h" @@ -161,7 +161,7 @@ DraggedTabData DraggedTabControllerGtk::InitDraggedTabData(TabGtk* tab) { registrar_.Add( this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED, - Source<TabContents>(dragged_tab_data.contents_->tab_contents())); + content::Source<TabContents>(dragged_tab_data.contents_->tab_contents())); return dragged_tab_data; } @@ -233,13 +233,14 @@ DraggedTabControllerGtk::GetJavaScriptDialogCreator() { } //////////////////////////////////////////////////////////////////////////////// -// DraggedTabControllerGtk, NotificationObserver implementation: +// DraggedTabControllerGtk, content::NotificationObserver implementation: -void DraggedTabControllerGtk::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void DraggedTabControllerGtk::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(type == content::NOTIFICATION_TAB_CONTENTS_DESTROYED); - TabContents* destroyed_contents = Source<TabContents>(source).ptr(); + TabContents* destroyed_contents = content::Source<TabContents>(source).ptr(); for (size_t i = 0; i < drag_data_->size(); ++i) { if (drag_data_->get(i)->contents_->tab_contents() == destroyed_contents) { // One of the tabs we're dragging has been destroyed. Cancel the drag. @@ -861,7 +862,8 @@ void DraggedTabControllerGtk::CleanUpDraggedTabs() { if (drag_data_->get(i)->contents_) { registrar_.Remove( this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED, - Source<TabContents>(drag_data_->get(i)->contents_->tab_contents())); + content::Source<TabContents>( + drag_data_->get(i)->contents_->tab_contents())); } source_tabstrip_->DestroyDraggedTab(drag_data_->get(i)->tab_); drag_data_->get(i)->tab_ = NULL; diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h index 77ccdb2..51ce822 100644 --- a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h +++ b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h @@ -16,8 +16,8 @@ #include "chrome/browser/ui/gtk/tabs/drag_data.h" #include "chrome/browser/ui/tabs/dock_info.h" #include "content/browser/tab_contents/tab_contents_delegate.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" #include "ui/base/x/x11_util.h" class DraggedViewGtk; @@ -26,7 +26,7 @@ class TabStripGtk; class TabStripModel; class TabContentsWrapper; -class DraggedTabControllerGtk : public NotificationObserver, +class DraggedTabControllerGtk : public content::NotificationObserver, public TabContentsDelegate { public: // |source_tabstrip| is the tabstrip where the tabs reside before any @@ -105,10 +105,10 @@ class DraggedTabControllerGtk : public NotificationObserver, virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator() OVERRIDE; - // Overridden from NotificationObserver: + // Overridden from content::NotificationObserver: virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); // Returns the point where a detached window should be created given the // current mouse position. @@ -221,7 +221,7 @@ class DraggedTabControllerGtk : public NotificationObserver, bool AreTabsConsecutive(); // Handles registering for notifications. - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; // The tab strip |source_tab_| originated from. TabStripGtk* source_tabstrip_; diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc index 1d416dc..0058ee5 100644 --- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc @@ -158,7 +158,7 @@ TabRendererGtk::LoadingAnimation::LoadingAnimation( animation_frame_(0) { registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, - Source<ThemeService>(theme_service_)); + content::Source<ThemeService>(theme_service_)); } TabRendererGtk::LoadingAnimation::LoadingAnimation( @@ -202,8 +202,8 @@ bool TabRendererGtk::LoadingAnimation::ValidateLoadingAnimation( void TabRendererGtk::LoadingAnimation::Observe( int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK(type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED); data_.reset(new Data(theme_service_)); } @@ -276,7 +276,7 @@ TabRendererGtk::TabRendererGtk(ThemeService* theme_service) hover_animation_->SetSlideDuration(kHoverDurationMs); registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, - Source<ThemeService>(theme_service_)); + content::Source<ThemeService>(theme_service_)); } TabRendererGtk::~TabRendererGtk() { @@ -556,7 +556,7 @@ void TabRendererGtk::SetBounds(const gfx::Rect& bounds) { } void TabRendererGtk::Observe(int type, - const NotificationSource& source, + const content::NotificationSource& source, const NotificationDetails& details) { DCHECK(type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED); diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h index 4e702f7..2e05537 100644 --- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h +++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h @@ -12,8 +12,8 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/string16.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/animation/animation_delegate.h" #include "ui/base/gtk/gtk_signal.h" @@ -36,7 +36,7 @@ class ThrobAnimation; } class TabRendererGtk : public ui::AnimationDelegate, - public NotificationObserver { + public content::NotificationObserver { public: // Possible animation states. enum AnimationState { @@ -45,7 +45,7 @@ class TabRendererGtk : public ui::AnimationDelegate, ANIMATION_LOADING }; - class LoadingAnimation : public NotificationObserver { + class LoadingAnimation : public content::NotificationObserver { public: struct Data { explicit Data(ThemeService* theme_service); @@ -80,16 +80,16 @@ class TabRendererGtk : public ui::AnimationDelegate, return data_->loading_animation_frames; } - // Provide NotificationObserver implementation. + // Provide content::NotificationObserver implementation. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); private: scoped_ptr<Data> data_; // Used to listen for theme change notifications. - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; // Gives us our throbber images. ThemeService* theme_service_; @@ -165,7 +165,7 @@ class TabRendererGtk : public ui::AnimationDelegate, // Provide NotificationObserver implementation. virtual void Observe(int type, - const NotificationSource& source, + const content::NotificationSource& source, const NotificationDetails& details); // Advance the loading animation to the next frame, or hide the animation if @@ -456,7 +456,7 @@ class TabRendererGtk : public ui::AnimationDelegate, bool is_active_; // Used to listen for theme change notifications. - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; DISALLOW_COPY_AND_ASSIGN(TabRendererGtk); }; diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc index d129c8a..a14ea30 100644 --- a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc @@ -710,7 +710,7 @@ TabStripGtk::TabStripGtk(TabStripModel* model, BrowserWindowGtk* window) hover_tab_selector_(model) { theme_service_->InitThemesFor(this); registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, - Source<ThemeService>(theme_service_)); + content::Source<ThemeService>(theme_service_)); } TabStripGtk::~TabStripGtk() { @@ -1307,11 +1307,11 @@ void TabStripGtk::DidProcessEvent(GdkEvent* event) { } /////////////////////////////////////////////////////////////////////////////// -// TabStripGtk, NotificationObserver implementation: +// TabStripGtk, content::NotificationObserver implementation: void TabStripGtk::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED) { TabRendererGtk::SetSelectedTitleColor(theme_service_->GetColor( ThemeService::COLOR_TAB_TEXT)); diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h index 62cb727..bccd717 100644 --- a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h +++ b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h @@ -18,7 +18,7 @@ #include "chrome/browser/ui/gtk/tabstrip_origin_provider.h" #include "chrome/browser/ui/gtk/view_id_util.h" #include "chrome/browser/ui/tabs/hover_tab_selector.h" -#include "content/common/notification_observer.h" +#include "content/public/browser/notification_observer.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/base/gtk/owned_widget_gtk.h" #include "ui/gfx/rect.h" @@ -31,7 +31,7 @@ class GtkThemeService; class TabStripGtk : public TabStripModelObserver, public TabGtk::TabDelegate, public MessageLoopForUI::Observer, - public NotificationObserver, + public content::NotificationObserver, public TabstripOriginProvider, public ViewIDUtil::Delegate { public: @@ -156,10 +156,10 @@ class TabStripGtk : public TabStripModelObserver, virtual void WillProcessEvent(GdkEvent* event); virtual void DidProcessEvent(GdkEvent* event); - // Overridden from NotificationObserver: + // Overridden from content::NotificationObserver: virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); // Horizontal gap between mini-tabs and normal tabs. static const int mini_to_non_mini_gap_; @@ -417,7 +417,7 @@ class TabStripGtk : public TabStripModelObserver, // Optionally a full Layout will be performed, specified by |layout|. void FinishAnimation(TabAnimation* animation, bool layout); - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; // The Tabs we contain, and their last generated "good" bounds. std::vector<TabData> tab_data_; |