summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-26 00:38:13 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-26 00:38:13 +0000
commitcd7f69091a1579815606d9b8b51e3de0e34e0596 (patch)
treea0fc71658010090143f4abd49cf95fa9483cb8d3 /chrome
parent24fd0b7823a8e47bf9f7df8290bb68a8f3adf79d (diff)
downloadchromium_src-cd7f69091a1579815606d9b8b51e3de0e34e0596.zip
chromium_src-cd7f69091a1579815606d9b8b51e3de0e34e0596.tar.gz
chromium_src-cd7f69091a1579815606d9b8b51e3de0e34e0596.tar.bz2
Reverting my previous commit, it seems to be breaking the UI tests in debug mode.
Review URL: http://codereview.chromium.org/12666 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/tab_contents.cc6
-rw-r--r--chrome/browser/tab_contents.h8
-rw-r--r--chrome/browser/views/frame/browser_view.cc9
3 files changed, 3 insertions, 20 deletions
diff --git a/chrome/browser/tab_contents.cc b/chrome/browser/tab_contents.cc
index ebd8f2b..9bdca3c 100644
--- a/chrome/browser/tab_contents.cc
+++ b/chrome/browser/tab_contents.cc
@@ -46,8 +46,7 @@ TabContents::TabContents(TabContentsType type)
shelf_visible_(false),
max_page_id_(-1),
blocked_popups_(NULL),
- capturing_contents_(false),
- is_being_destroyed_(false) {
+ capturing_contents_(false) {
last_focused_view_storage_id_ =
views::ViewStorage::GetSharedInstance()->CreateStorageID();
}
@@ -76,9 +75,6 @@ void TabContents::CloseContents() {
}
void TabContents::Destroy() {
- DCHECK(!is_being_destroyed_);
- is_being_destroyed_ = true;
-
// 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
diff --git a/chrome/browser/tab_contents.h b/chrome/browser/tab_contents.h
index dad5f63..2f78a79 100644
--- a/chrome/browser/tab_contents.h
+++ b/chrome/browser/tab_contents.h
@@ -246,11 +246,6 @@ class TabContents : public PageNavigator,
bool is_active() const { return is_active_; }
void set_is_active(bool active) { is_active_ = active; }
- // Whether the tab is in the process of being destroyed.
- // Added as a tentative work-around for focus related bug #4633. This allows
- // us not to store focus when a tab is being closed.
- bool is_being_destroyed() const { return is_being_destroyed_; }
-
// Convenience method for notifying the delegate of a navigation state
// change. See TabContentsDelegate.
void NotifyNavigationStateChanged(unsigned changed_flags);
@@ -547,9 +542,6 @@ class TabContents : public PageNavigator,
// Delegates for InfoBars associated with this TabContents.
std::vector<InfoBarDelegate*> infobar_delegates_;
- // See getter above.
- bool is_being_destroyed_;
-
DISALLOW_COPY_AND_ASSIGN(TabContents);
};
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 019fdc8..91b148c 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -647,10 +647,7 @@ void BrowserView::TabSelectedAt(TabContents* old_contents,
bool user_gesture) {
DCHECK(old_contents != new_contents);
- // We do not store the focus when closing the tab to work-around bug 4633.
- // Some reports seem to show that the focus manager and/or focused view can
- // be garbage at that point, it is not clear why.
- if (old_contents && !old_contents->is_being_destroyed())
+ if (old_contents)
old_contents->StoreFocus();
// Update various elements that are interested in knowing the current
@@ -662,10 +659,8 @@ void BrowserView::TabSelectedAt(TabContents* old_contents,
// required to make features like Duplicate Tab, Undo Close Tab,
// etc not result in sad tab.
new_contents->DidBecomeSelected();
- if (BrowserList::GetLastActive() == browser_ &&
- !browser_->tabstrip_model()->closing_all()) {
+ if (BrowserList::GetLastActive() == browser_)
new_contents->RestoreFocus();
- }
// Update all the UI bits.
UpdateTitleBar();