| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/views/frame/browser_view.h" | 5 #include "chrome/browser/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 // Update various elements that are interested in knowing the current | 907 // Update various elements that are interested in knowing the current |
| 908 // TabContents. | 908 // TabContents. |
| 909 infobar_container_->ChangeTabContents(new_contents); | 909 infobar_container_->ChangeTabContents(new_contents); |
| 910 contents_container_->SetTabContents(new_contents); | 910 contents_container_->SetTabContents(new_contents); |
| 911 // TODO(beng): This should be called automatically by SetTabContents, but I | 911 // TODO(beng): This should be called automatically by SetTabContents, but I |
| 912 // am striving for parity now rather than cleanliness. This is | 912 // am striving for parity now rather than cleanliness. This is |
| 913 // required to make features like Duplicate Tab, Undo Close Tab, | 913 // required to make features like Duplicate Tab, Undo Close Tab, |
| 914 // etc not result in sad tab. | 914 // etc not result in sad tab. |
| 915 new_contents->DidBecomeSelected(); | 915 new_contents->DidBecomeSelected(); |
| 916 if (BrowserList::GetLastActive() == browser_ && | 916 if (BrowserList::GetLastActive() == browser_ && |
| 917 !browser_->tabstrip_model()->closing_all() && | 917 !browser_->tabstrip_model()->closing_all() && GetWindow()->IsVisible()) { |
| 918 GetWidget()->GetWindow()->IsVisible()) { | |
| 919 // We only restore focus if our window is visible, to avoid invoking blur | 918 // We only restore focus if our window is visible, to avoid invoking blur |
| 920 // handlers when we are eventually shown. | 919 // handlers when we are eventually shown. |
| 921 new_contents->view()->RestoreFocus(); | 920 new_contents->view()->RestoreFocus(); |
| 922 } | 921 } |
| 923 | 922 |
| 924 // Update all the UI bits. | 923 // Update all the UI bits. |
| 925 UpdateTitleBar(); | 924 UpdateTitleBar(); |
| 926 toolbar_->SetProfile(new_contents->profile()); | 925 toolbar_->SetProfile(new_contents->profile()); |
| 927 UpdateToolbar(new_contents, true); | 926 UpdateToolbar(new_contents, true); |
| 928 UpdateUIForContents(new_contents); | 927 UpdateUIForContents(new_contents); |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 1633 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 1635 BrowserView* browser_view = new BrowserView(browser); | 1634 BrowserView* browser_view = new BrowserView(browser); |
| 1636 (new BrowserFrame(browser_view))->Init(); | 1635 (new BrowserFrame(browser_view))->Init(); |
| 1637 return browser_view; | 1636 return browser_view; |
| 1638 } | 1637 } |
| 1639 | 1638 |
| 1640 // static | 1639 // static |
| 1641 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 1640 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
| 1642 return new FindBarWin(static_cast<BrowserView*>(browser->window())); | 1641 return new FindBarWin(static_cast<BrowserView*>(browser->window())); |
| 1643 } | 1642 } |
| OLD | NEW |