summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-23 23:58:12 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-23 23:58:12 +0000
commitea42e778f31ab38a5e0d7e172c90e9abc2fd1588 (patch)
tree62844f3402bf776da1a52e4145c3ed40ede95d03 /chrome/browser/browser.cc
parent769e9080186fa376091519fcec8f2f01ea61ab14 (diff)
downloadchromium_src-ea42e778f31ab38a5e0d7e172c90e9abc2fd1588.zip
chromium_src-ea42e778f31ab38a5e0d7e172c90e9abc2fd1588.tar.gz
chromium_src-ea42e778f31ab38a5e0d7e172c90e9abc2fd1588.tar.bz2
Relanding a previous CL (I fixed the ChromeOS build):
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). TBR=darin,sky 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/3174030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57124 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index d012fff4..3811898 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -2660,6 +2660,10 @@ 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();
@@ -2803,14 +2807,6 @@ 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;
}