summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 19:44:37 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 19:44:37 +0000
commit9e0c83afb60137655440e49adf3bc73b3e2c6f31 (patch)
treec839619e32e6e1c6f7c10bb4b4fcd50248a8695b /chrome/browser/views
parentcd63ef62b897937521c6943b554608b3f9349d27 (diff)
downloadchromium_src-9e0c83afb60137655440e49adf3bc73b3e2c6f31.zip
chromium_src-9e0c83afb60137655440e49adf3bc73b3e2c6f31.tar.gz
chromium_src-9e0c83afb60137655440e49adf3bc73b3e2c6f31.tar.bz2
The last redesign of interstitial pages made them to be a render view painted on top of the normal page.
Because they were not know from the tab contents container, the actual hidden page behind them would still get focus. That was particularly noticeable when tabbing. BUG=11505 TEST=Open a page that triggers an interstitial (ex: https://ebay.com). Press tab to cycle the focus. Make sure the focus is moved as expected. Review URL: http://codereview.chromium.org/113039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/tab_contents_container_view.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/views/tab_contents_container_view.cc b/chrome/browser/views/tab_contents_container_view.cc
index 05aa615..4a3311d 100644
--- a/chrome/browser/views/tab_contents_container_view.cc
+++ b/chrome/browser/views/tab_contents_container_view.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
+#include "chrome/browser/tab_contents/interstitial_page.h"
#include "chrome/browser/tab_contents/render_view_host_manager.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents.h"
@@ -101,6 +102,11 @@ void TabContentsContainerView::AboutToRequestFocusFromTabTraversal(
if (!tab_contents_)
return;
// Give an opportunity to the tab to reset its focus.
+ InterstitialPage* interstitial = tab_contents_->interstitial_page();
+ if (interstitial) {
+ interstitial->SetInitialFocus(reverse);
+ return;
+ }
tab_contents_->SetInitialFocus(reverse);
}
@@ -120,7 +126,13 @@ views::View* TabContentsContainerView::GetFocusTraversableParentView() {
void TabContentsContainerView::Focus() {
if (tab_contents_) {
- // Set the native focus on the actual content of the tab.
+ // Set the native focus on the actual content of the tab, that is the
+ // interstitial if one is showing.
+ InterstitialPage* interstitial = tab_contents_->interstitial_page();
+ if (interstitial) {
+ interstitial->Focus();
+ return;
+ }
::SetFocus(tab_contents_->GetContentNativeView());
}
}