summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 13:21:35 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 13:21:35 +0000
commit332af773603ecd4c78eca598c5f7ce8d70304381 (patch)
tree488022539a7f86b2738f3dbbebf27a8404b49f0c /chrome/browser
parent0c3a4045d8f50a0c7b7962f5d496927ad5b4e717 (diff)
downloadchromium_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')
-rw-r--r--chrome/browser/back_forward_menu_model_unittest.cc8
-rw-r--r--chrome/browser/browser.h2
-rw-r--r--chrome/browser/cocoa/tab_contents_controller.mm1
-rw-r--r--chrome/browser/cocoa/tab_strip_controller.mm2
-rw-r--r--chrome/browser/download/download_shelf.cc2
-rw-r--r--chrome/browser/gtk/download_shelf_gtk.cc4
-rw-r--r--chrome/browser/tab_contents/infobar_delegate.cc7
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc31
-rw-r--r--chrome/browser/tab_contents/tab_contents.h6
-rw-r--r--chrome/browser/tab_contents/web_contents.h2
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc8
-rw-r--r--chrome/browser/tabs/tab_strip_model_order_controller.cc5
-rw-r--r--chrome/browser/toolbar_model.cc7
13 files changed, 33 insertions, 52 deletions
diff --git a/chrome/browser/back_forward_menu_model_unittest.cc b/chrome/browser/back_forward_menu_model_unittest.cc
index e1ed357..1e9cf09 100644
--- a/chrome/browser/back_forward_menu_model_unittest.cc
+++ b/chrome/browser/back_forward_menu_model_unittest.cc
@@ -11,17 +11,11 @@
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_factory.h"
#include "chrome/common/url_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if defined(OS_WIN)
-// TODO(port): port this header.
-#include "chrome/browser/tab_contents/tab_contents.h"
-#elif defined(OS_POSIX)
-#include "chrome/common/temp_scaffolding_stubs.h"
-#endif
-
const TabContentsType kHTTPTabContentsType =
static_cast<TabContentsType>(TAB_CONTENTS_NUM_TYPES + 1);
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index d6977822..3c3bb7e 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -19,6 +19,7 @@
#include "chrome/browser/browser_window.h"
#include "chrome/browser/command_updater.h"
#include "chrome/browser/sessions/session_id.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
#include "chrome/browser/toolbar_model.h"
@@ -30,7 +31,6 @@
#if defined(OS_WIN)
#include "chrome/browser/shell_dialogs.h"
-#include "chrome/browser/tab_contents/tab_contents.h"
#endif
class BrowserIdleTimer;
diff --git a/chrome/browser/cocoa/tab_contents_controller.mm b/chrome/browser/cocoa/tab_contents_controller.mm
index f20038e..331ec20 100644
--- a/chrome/browser/cocoa/tab_contents_controller.mm
+++ b/chrome/browser/cocoa/tab_contents_controller.mm
@@ -8,6 +8,7 @@
#import "chrome/app/chrome_dll_resource.h"
#import "chrome/browser/command_updater.h"
#import "chrome/browser/location_bar.h"
+#import "chrome/browser/tab_contents/tab_contents.h"
#import "chrome/browser/toolbar_model.h"
// For now, tab_contents lives here. TODO(port):fix
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm
index 26717d1..2e23032 100644
--- a/chrome/browser/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/cocoa/tab_strip_controller.mm
@@ -9,8 +9,8 @@
#import "chrome/browser/cocoa/tab_strip_view.h"
#import "chrome/browser/cocoa/tab_cell.h"
#import "chrome/browser/cocoa/tab_contents_controller.h"
+#import "chrome/browser/tab_contents/tab_contents.h"
#import "chrome/browser/tabs/tab_strip_model.h"
-#import "chrome/common/temp_scaffolding_stubs.h"
// The amount of overlap tabs have in their button frames.
const short kTabOverlap = 16;
diff --git a/chrome/browser/download/download_shelf.cc b/chrome/browser/download/download_shelf.cc
index 9003a21..9644d26 100644
--- a/chrome/browser/download/download_shelf.cc
+++ b/chrome/browser/download/download_shelf.cc
@@ -9,12 +9,12 @@
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_manager.h"
#include "chrome/browser/metrics/user_metrics.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/download/download_util.h"
-#include "chrome/browser/tab_contents/tab_contents.h"
#elif defined(OS_POSIX)
#include "chrome/common/temp_scaffolding_stubs.h"
#endif
diff --git a/chrome/browser/gtk/download_shelf_gtk.cc b/chrome/browser/gtk/download_shelf_gtk.cc
index 54770ea..759a3fd 100644
--- a/chrome/browser/gtk/download_shelf_gtk.cc
+++ b/chrome/browser/gtk/download_shelf_gtk.cc
@@ -8,14 +8,12 @@
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/gtk/custom_button.h"
#include "chrome/browser/gtk/download_item_gtk.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
-// TODO(port): remove this after tab_contents.h is ported.
-#include "chrome/common/temp_scaffolding_stubs.h"
-
namespace {
// The height of the download items. Should be 28, as that is the height of
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;
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index e312071..36b8f52 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -6,18 +6,12 @@
#include <algorithm>
-#if defined(OS_WIN)
-#include "chrome/browser/tab_contents/tab_contents.h"
-#elif defined(OS_MACOSX) || (OS_LINUX)
-// TODO(port): remove this when the mocks of the above classes are removed
-#include "chrome/common/temp_scaffolding_stubs.h"
-#endif
-
#include "base/string_util.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/tabs/tab_strip_model_order_controller.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/stl_util-inl.h"
#include "chrome/common/url_constants.h"
diff --git a/chrome/browser/tabs/tab_strip_model_order_controller.cc b/chrome/browser/tabs/tab_strip_model_order_controller.cc
index f483f2b..0c6326a 100644
--- a/chrome/browser/tabs/tab_strip_model_order_controller.cc
+++ b/chrome/browser/tabs/tab_strip_model_order_controller.cc
@@ -4,12 +4,7 @@
#include "chrome/browser/tabs/tab_strip_model_order_controller.h"
-#if defined(OS_WIN)
#include "chrome/browser/tab_contents/tab_contents.h"
-#elif defined(OS_MACOSX) || (OS_LINUX)
-// TODO(port): remove this when the mock of TabContents is removed
-#include "chrome/common/temp_scaffolding_stubs.h"
-#endif
#include "chrome/common/pref_names.h"
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/toolbar_model.cc b/chrome/browser/toolbar_model.cc
index 999514b..93a224c 100644
--- a/chrome/browser/toolbar_model.cc
+++ b/chrome/browser/toolbar_model.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/ssl/ssl_error_info.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
@@ -15,12 +16,6 @@
#include "grit/generated_resources.h"
#include "net/base/net_util.h"
-#if defined(OS_WIN)
-#include "chrome/browser/tab_contents/tab_contents.h"
-#elif defined(OS_POSIX)
-// TODO(port): remove when tab_contents is ported
-#include "chrome/common/temp_scaffolding_stubs.h"
-#endif
ToolbarModel::ToolbarModel() : input_in_progress_(false) {
}