diff options
author | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 20:26:58 +0000 |
---|---|---|
committer | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 20:26:58 +0000 |
commit | 3de760388c0fd01fc9dc69f7c2cf780ce8421995 (patch) | |
tree | 0a1d139513cf86240c5c202c10d4c3c333cd040d /chrome/browser/browser.cc | |
parent | 3aa054ce8c48f06b32ea367bf79f42a70bfefa5f (diff) | |
download | chromium_src-3de760388c0fd01fc9dc69f7c2cf780ce8421995.zip chromium_src-3de760388c0fd01fc9dc69f7c2cf780ce8421995.tar.gz chromium_src-3de760388c0fd01fc9dc69f7c2cf780ce8421995.tar.bz2 |
Revert 57094 - Making window.focus()/blur() work only when there is a user gesture.
Also making window.focus() select tab if it is not visible.
The RenderViewHost now calls ActivateContent and the new DeactivateContent (instead of using the recently added TabContentsDelegate::Activate/Deactivate methods which have been removed).
BUG=29643,52346
TEST=Create a page with buttons that call window.focus()/blur() directly and with a timeout. When called directly, the calls should succeed (the browser should be activated/deactivated). When called with a timeout, nothing should happen. Also test that a popup calling window.opener.focus() cause the opening tab to become selected when it is not the current tab.
Review URL: http://codereview.chromium.org/3156016
TBR=jcivelli@chromium.org
Review URL: http://codereview.chromium.org/3201008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index e4a5f8c..f8c91744 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -2659,10 +2659,6 @@ void Browser::ActivateContents(TabContents* contents) { window_->Activate(); } -void Browser::DeactivateContents(TabContents* contents) { - window_->Deactivate(); -} - void Browser::LoadingStateChanged(TabContents* source) { window_->UpdateLoadingAnimations(tabstrip_model_.TabsAreLoading()); window_->UpdateTitleBar(); @@ -2806,6 +2802,14 @@ bool Browser::TakeFocus(bool reverse) { return false; } +void Browser::Activate() { + window_->Activate(); +} + +void Browser::Deactivate() { + window_->Deactivate(); +} + bool Browser::IsApplication() const { return (type_ & TYPE_APP) != 0; } |