diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-11 13:21:35 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-11 13:21:35 +0000 |
commit | 332af773603ecd4c78eca598c5f7ce8d70304381 (patch) | |
tree | 488022539a7f86b2738f3dbbebf27a8404b49f0c /chrome/browser/tab_contents | |
parent | 0c3a4045d8f50a0c7b7962f5d496927ad5b4e717 (diff) | |
download | chromium_src-332af773603ecd4c78eca598c5f7ce8d70304381.zip chromium_src-332af773603ecd4c78eca598c5f7ce8d70304381.tar.gz chromium_src-332af773603ecd4c78eca598c5f7ce8d70304381.tar.bz2 |
Remove TabContents from scaffolding. Yay!
Review URL: http://codereview.chromium.org/43039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/infobar_delegate.cc | 7 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 31 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents.h | 2 |
4 files changed, 25 insertions, 21 deletions
diff --git a/chrome/browser/tab_contents/infobar_delegate.cc b/chrome/browser/tab_contents/infobar_delegate.cc index b1b63f9..6925dda 100644 --- a/chrome/browser/tab_contents/infobar_delegate.cc +++ b/chrome/browser/tab_contents/infobar_delegate.cc @@ -8,15 +8,10 @@ #include "build/build_config.h" #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/navigation_controller.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/l10n_util.h" #include "grit/generated_resources.h" -#if defined(OS_WIN) -#include "chrome/browser/tab_contents/tab_contents.h" -#else -#include "chrome/common/temp_scaffolding_stubs.h" -#endif - // InfoBarDelegate: ------------------------------------------------------------ bool InfoBarDelegate::ShouldExpire( diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index d9c7191..4da0609 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -2,12 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(OS_WIN) #include "chrome/browser/tab_contents/tab_contents.h" -#elif defined(OS_POSIX) -// TODO(port): port the rest of this file. -#include "chrome/common/temp_scaffolding_stubs.h" -#endif #include "chrome/browser/cert_store.h" #include "chrome/browser/download/download_item_model.h" @@ -44,6 +39,7 @@ BOOL CALLBACK InvalidateWindow(HWND hwnd, LPARAM lparam) { } } // namespace +#endif TabContents::TabContents(TabContentsType type) : type_(type), @@ -55,13 +51,14 @@ TabContents::TabContents(TabContentsType type) waiting_for_response_(false), shelf_visible_(false), max_page_id_(-1), - blocked_popups_(NULL), capturing_contents_(false), + blocked_popups_(NULL), is_being_destroyed_(false) { +#if defined(OS_WIN) last_focused_view_storage_id_ = views::ViewStorage::GetSharedInstance()->CreateStorageID(); -} #endif +} TabContents::~TabContents() { #if defined(OS_WIN) @@ -91,7 +88,6 @@ void TabContents::Destroy() { DCHECK(!is_being_destroyed_); is_being_destroyed_ = true; -#if defined(OS_WIN) // First cleanly close all child windows. // TODO(mpcomplete): handle case if MaybeCloseChildWindows() already asked // some of these to close. CloseWindows is async, so it might get called @@ -111,7 +107,6 @@ void TabContents::Destroy() { delegate->InfoBarClosed(); } infobar_delegates_.clear(); -#endif // Notify any observer that have a reference on this tab contents. NotificationService::current()->Notify( @@ -353,8 +348,10 @@ void TabContents::CloseAllSuppressedPopups() { if (blocked_popups_) blocked_popups_->CloseAllPopups(); } +#endif void TabContents::Focus() { +#if defined(OS_WIN) HWND container_hwnd = GetNativeView(); if (!container_hwnd) return; @@ -366,9 +363,11 @@ void TabContents::Focus() { DCHECK(v); if (v) v->RequestFocus(); +#endif } void TabContents::StoreFocus() { +#if defined(OS_WIN) views::ViewStorage* view_storage = views::ViewStorage::GetSharedInstance(); @@ -397,9 +396,11 @@ void TabContents::StoreFocus() { } } } +#endif } void TabContents::RestoreFocus() { +#if defined(OS_WIN) views::ViewStorage* view_storage = views::ViewStorage::GetSharedInstance(); views::View* last_focused_view = @@ -427,10 +428,13 @@ void TabContents::RestoreFocus() { } view_storage->RemoveView(last_focused_view_storage_id_); } +#endif } void TabContents::SetInitialFocus() { +#if defined(OS_WIN) ::SetFocus(GetNativeView()); +#endif } void TabContents::AddInfoBar(InfoBarDelegate* delegate) { @@ -475,7 +479,6 @@ void TabContents::RemoveInfoBar(InfoBarDelegate* delegate) { } } } -#endif // defined(OS_WIN) void TabContents::ToolbarSizeChanged(bool is_animating) { TabContentsDelegate* d = delegate(); @@ -553,13 +556,13 @@ void TabContents::MigrateShelf(TabContents* from, TabContents* to) { to->SetDownloadShelfVisible(was_shelf_visible); } -#if defined(OS_WIN) void TabContents::WillClose(ConstrainedWindow* window) { ConstrainedWindowList::iterator it = find(child_windows_.begin(), child_windows_.end(), window); if (it != child_windows_.end()) child_windows_.erase(it); +#if defined(OS_WIN) if (window == blocked_popups_) blocked_popups_ = NULL; @@ -569,10 +572,13 @@ void TabContents::WillClose(ConstrainedWindow* window) { RepositionSupressedPopupsToFit( gfx::Size(client_rect.Width(), client_rect.Height())); } +#endif } void TabContents::DidMoveOrResize(ConstrainedWindow* window) { +#if defined(OS_WIN) UpdateWindow(GetNativeView()); +#endif } void TabContents::Observe(NotificationType type, @@ -585,7 +591,6 @@ void TabContents::Observe(NotificationType type, *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); ExpireInfoBars(committed_details); } -#endif void TabContents::SetIsLoading(bool is_loading, LoadNotificationDetails* details) { @@ -633,6 +638,7 @@ bool TabContents::ShowingBlockedPopupNotification() const { return blocked_popups_ != NULL && blocked_popups_->GetTabContentsCount() != 0; } +#endif // defined(OS_WIN) namespace { bool TransitionIsReload(PageTransition::Type transition) { @@ -654,4 +660,3 @@ void TabContents::ExpireInfoBars( RemoveInfoBar(delegate); } } -#endif // defined(OS_WIN) diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index e0ea375..7d0e562 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -15,8 +15,10 @@ #if defined(OS_WIN) // TODO(evanm): I mean really, c'mon, this can't have broken the build, right? #include "chrome/browser/autocomplete/autocomplete_edit.h" -#endif #include "chrome/browser/tab_contents/constrained_window.h" +#else +#include "chrome/common/temp_scaffolding_stubs.h" +#endif #include "chrome/browser/tab_contents/infobar_delegate.h" #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/page_navigator.h" @@ -312,6 +314,7 @@ class TabContents : public PageNavigator, // Window management --------------------------------------------------------- +#if defined(OS_WIN) // Create a new window constrained to this TabContents' clip and visibility. // The window is initialized by using the supplied delegate to obtain basic // window characteristics, and the supplied view for the content. The window @@ -320,6 +323,7 @@ class TabContents : public PageNavigator, ConstrainedWindow* CreateConstrainedDialog( views::WindowDelegate* window_delegate, views::View* contents_view); +#endif // Adds a new tab or window with the given already-created contents void AddNewContents(TabContents* new_contents, diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h index 8496841..37c4ef7 100644 --- a/chrome/browser/tab_contents/web_contents.h +++ b/chrome/browser/tab_contents/web_contents.h @@ -18,6 +18,7 @@ #include "chrome/browser/renderer_host/render_view_host_delegate.h" #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/render_view_host_manager.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/gears_api.h" #include "net/base/load_states.h" #include "webkit/glue/password_form.h" @@ -29,7 +30,6 @@ #elif defined(OS_WIN) #include "chrome/browser/printing/print_view_manager.h" #include "chrome/browser/shell_dialogs.h" -#include "chrome/browser/tab_contents/tab_contents.h" #endif class AutofillForm; |