| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 #if defined(OS_WIN) | 242 #if defined(OS_WIN) |
| 243 // Open a new browser window. | 243 // Open a new browser window. |
| 244 Browser* browser2 = Browser::Create(browser()->profile()); | 244 Browser* browser2 = Browser::Create(browser()->profile()); |
| 245 ASSERT_TRUE(browser2); | 245 ASSERT_TRUE(browser2); |
| 246 browser2->tabstrip_model()->delegate()->AddBlankTab(true); | 246 browser2->tabstrip_model()->delegate()->AddBlankTab(true); |
| 247 browser2->window()->Show(); | 247 browser2->window()->Show(); |
| 248 ui_test_utils::NavigateToURL(browser2, url); | 248 ui_test_utils::NavigateToURL(browser2, url); |
| 249 | 249 |
| 250 gfx::NativeWindow window2 = browser2->window()->GetNativeHandle(); | 250 gfx::NativeWindow window2 = browser2->window()->GetNativeHandle(); |
| 251 BrowserView* browser_view2 = | 251 BrowserView* browser_view2 = |
| 252 BrowserView::GetBrowserViewForNativeWindow(window2); | 252 BrowserView::GetBrowserViewForBrowser(browser2); |
| 253 ASSERT_TRUE(browser_view2); | 253 ASSERT_TRUE(browser_view2); |
| 254 views::Widget* widget2 = views::Widget::GetWidgetForNativeWindow(window2); | 254 views::Widget* widget2 = views::Widget::GetWidgetForNativeWindow(window2); |
| 255 ASSERT_TRUE(widget2); | 255 ASSERT_TRUE(widget2); |
| 256 views::FocusManager* focus_manager2 = widget2->GetFocusManager(); | 256 views::FocusManager* focus_manager2 = widget2->GetFocusManager(); |
| 257 ASSERT_TRUE(focus_manager2); | 257 ASSERT_TRUE(focus_manager2); |
| 258 EXPECT_EQ(browser_view2->GetTabContentsContainerView(), | 258 EXPECT_EQ(browser_view2->GetTabContentsContainerView(), |
| 259 focus_manager2->GetFocusedView()); | 259 focus_manager2->GetFocusedView()); |
| 260 | 260 |
| 261 // Switch to the 1st browser window, focus should still be on the location | 261 // Switch to the 1st browser window, focus should still be on the location |
| 262 // bar and the second browser should have nothing focused. | 262 // bar and the second browser should have nothing focused. |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 browser()->Reload(CURRENT_TAB); | 902 browser()->Reload(CURRENT_TAB); |
| 903 observer.Wait(); | 903 observer.Wait(); |
| 904 } | 904 } |
| 905 | 905 |
| 906 // Focus should now be on the tab contents. | 906 // Focus should now be on the tab contents. |
| 907 browser()->ShowDownloadsTab(); | 907 browser()->ShowDownloadsTab(); |
| 908 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); | 908 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); |
| 909 } | 909 } |
| 910 | 910 |
| 911 } // namespace | 911 } // namespace |
| OLD | NEW |