diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 00:21:28 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 00:21:28 +0000 |
commit | 401513c474b3520fe784c03e068a15fc6655d6e1 (patch) | |
tree | 9d5368feb8f3a668ec4523e90bc9694bcfc3a9d3 /chrome/browser/sessions/session_restore.cc | |
parent | a8e9b16e3e3f944d0eaf7f91e5cc96a7b2c914d3 (diff) | |
download | chromium_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/sessions/session_restore.cc')
-rw-r--r-- | chrome/browser/sessions/session_restore.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc index 51c5403..9563204 100644 --- a/chrome/browser/sessions/session_restore.cc +++ b/chrome/browser/sessions/session_restore.cc @@ -14,6 +14,8 @@ #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sessions/session_types.h" #include "chrome/browser/tab_contents/navigation_controller.h" +#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/web_contents_view.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/notification_service.h" @@ -363,7 +365,10 @@ class SessionRestoreImpl : public NotificationObserver { browser->window()->Show(); // TODO(jcampan): http://crbug.com/8123 we should not need to set the // initial focus explicitly. - browser->GetSelectedTabContents()->SetInitialFocus(); + if (browser->GetSelectedTabContents()->AsWebContents()) { + browser->GetSelectedTabContents()->AsWebContents()->view()-> + SetInitialFocus(); + } } void AppendURLsToBrowser(Browser* browser, const std::vector<GURL>& urls) { |