summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 00:21:28 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 00:21:28 +0000
commit401513c474b3520fe784c03e068a15fc6655d6e1 (patch)
tree9d5368feb8f3a668ec4523e90bc9694bcfc3a9d3 /chrome/browser/browser.cc
parenta8e9b16e3e3f944d0eaf7f91e5cc96a7b2c914d3 (diff)
downloadchromium_src-401513c474b3520fe784c03e068a15fc6655d6e1.zip
chromium_src-401513c474b3520fe784c03e068a15fc6655d6e1.tar.gz
chromium_src-401513c474b3520fe784c03e068a15fc6655d6e1.tar.bz2
Moving the storing/restoring of the focus from TabContents to WebContentsView. This makes TabContents less dependent on views.
This requires few contortions with DOMUIs (NTP, history and downloads tab) as they still need to set the initial focus specifically. BUG=None TEST=Run the interactive tests. Review URL: http://codereview.chromium.org/39269 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index dea7ae1..cbbe84d 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -31,6 +31,7 @@
#include "chrome/browser/tab_contents/site_instance.h"
#include "chrome/browser/tab_contents/tab_contents_type.h"
#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/web_contents_view.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/l10n_util.h"
@@ -318,7 +319,7 @@ void Browser::OpenApplicationWindow(Profile* profile, const GURL& url) {
browser->window()->Show();
// TODO(jcampan): http://crbug.com/8123 we should not need to set the initial
// focus explicitly.
- browser->GetSelectedTabContents()->SetInitialFocus();
+ browser->GetSelectedTabContents()->AsWebContents()->view()->SetInitialFocus();
}
///////////////////////////////////////////////////////////////////////////////
@@ -657,8 +658,7 @@ void Browser::NewTab() {
// The call to AddBlankTab above did not set the focus to the tab as its
// window was not active, so we have to do it explicitly.
// See http://crbug.com/6380.
- TabContents* tab = b->GetSelectedTabContents();
- tab->RestoreFocus();
+ b->GetSelectedTabContents()->AsWebContents()->view()->RestoreFocus();
}
}