Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1033)

Unified Diff: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc

Issue 9085006: Replace Browser::GetTabContentsAt with GetWebContentsAt and update all callers. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac yet again Created 8 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_strip_gtk.h ('k') | chrome/browser/ui/panels/panel_browser_window_cocoa.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc (revision 116244)
+++ chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc (working copy)
@@ -29,8 +29,8 @@
#include "chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/chrome_notification_types.h"
-#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/web_contents.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
#include "grit/ui_resources.h"
@@ -44,6 +44,8 @@
#include "ui/gfx/image/image.h"
#include "ui/gfx/point.h"
+using content::WebContents;
+
namespace {
const int kDefaultAnimationDurationMs = 100;
@@ -333,7 +335,7 @@
// Handles removal of a Tab from |index|
class RemoveTabAnimation : public TabStripGtk::TabAnimation {
public:
- RemoveTabAnimation(TabStripGtk* tabstrip, int index, TabContents* contents)
+ RemoveTabAnimation(TabStripGtk* tabstrip, int index, WebContents* contents)
: TabAnimation(tabstrip, REMOVE),
index_(index) {
int tab_count = tabstrip->GetTabCount();
@@ -850,9 +852,9 @@
} else {
TabRendererGtk::AnimationState state;
TabContentsWrapper* contents = model_->GetTabContentsAt(index);
- if (!contents || !contents->tab_contents()->IsLoading()) {
+ if (!contents || !contents->web_contents()->IsLoading()) {
state = TabGtk::ANIMATION_NONE;
- } else if (contents->tab_contents()->IsWaitingForResponse()) {
+ } else if (contents->web_contents()->IsWaitingForResponse()) {
state = TabGtk::ANIMATION_WAITING;
} else {
state = TabGtk::ANIMATION_LOADING;
@@ -983,7 +985,7 @@
// again.
if (IsDragSessionActive()) {
tab = drag_controller_->GetDraggedTabForContents(
- contents->tab_contents());
+ contents->web_contents());
if (tab) {
// If the Tab was detached, it would have been animated closed but not
// removed, so we need to reset this property.
@@ -1007,7 +1009,7 @@
if (!contains_tab) {
TabData d = { tab, gfx::Rect() };
tab_data_.insert(tab_data_.begin() + index, d);
- tab->UpdateData(contents->tab_contents(), model_->IsAppTab(index), false);
+ tab->UpdateData(contents->web_contents(), model_->IsAppTab(index), false);
}
tab->set_mini(model_->IsMiniTab(index));
tab->set_app(model_->IsAppTab(index));
@@ -1032,7 +1034,7 @@
void TabStripGtk::TabDetachedAt(TabContentsWrapper* contents, int index) {
GenerateIdealBounds();
- StartRemoveTabAnimation(index, contents->tab_contents());
+ StartRemoveTabAnimation(index, contents->web_contents());
// Have to do this _after_ calling StartRemoveTabAnimation, so that any
// previous remove is completed fully and index is valid in sync with the
// model index.
@@ -1120,7 +1122,7 @@
// We'll receive another notification of the change asynchronously.
return;
}
- tab->UpdateData(contents->tab_contents(),
+ tab->UpdateData(contents->web_contents(),
model_->IsAppTab(index),
change_type == LOADING_ONLY);
tab->UpdateFromModel();
@@ -1944,7 +1946,7 @@
active_animation_->Start();
}
-void TabStripGtk::StartRemoveTabAnimation(int index, TabContents* contents) {
+void TabStripGtk::StartRemoveTabAnimation(int index, WebContents* contents) {
if (active_animation_.get()) {
// Some animations (e.g. MoveTabAnimation) cause there to be a Layout when
// they're completed (which includes canceled). Since |tab_data_| is now
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_strip_gtk.h ('k') | chrome/browser/ui/panels/panel_browser_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698