| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "base/string16.h" | 6 #include "base/string16.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 EXPECT_EQ(0, ordinal); | 823 EXPECT_EQ(0, ordinal); |
| 824 } | 824 } |
| 825 | 825 |
| 826 #if defined(TOOLKIT_VIEWS) | 826 #if defined(TOOLKIT_VIEWS) |
| 827 // Make sure Find box grabs the Esc accelerator and restores it again. | 827 // Make sure Find box grabs the Esc accelerator and restores it again. |
| 828 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, AcceleratorRestoring) { | 828 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, AcceleratorRestoring) { |
| 829 // First we navigate to any page. | 829 // First we navigate to any page. |
| 830 GURL url = GetURL(kSimple); | 830 GURL url = GetURL(kSimple); |
| 831 ui_test_utils::NavigateToURL(browser(), url); | 831 ui_test_utils::NavigateToURL(browser(), url); |
| 832 | 832 |
| 833 gfx::NativeWindow window = browser()->window()->GetNativeHandle(); | 833 gfx::NativeWindow window = browser()->window()->GetNativeWindow(); |
| 834 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); | 834 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); |
| 835 views::FocusManager* focus_manager = widget->GetFocusManager(); | 835 views::FocusManager* focus_manager = widget->GetFocusManager(); |
| 836 | 836 |
| 837 // See where Escape is registered. | 837 // See where Escape is registered. |
| 838 ui::Accelerator escape(ui::VKEY_ESCAPE, ui::EF_NONE); | 838 ui::Accelerator escape(ui::VKEY_ESCAPE, ui::EF_NONE); |
| 839 ui::AcceleratorTarget* old_target = | 839 ui::AcceleratorTarget* old_target = |
| 840 focus_manager->GetCurrentTargetForAccelerator(escape); | 840 focus_manager->GetCurrentTargetForAccelerator(escape); |
| 841 EXPECT_TRUE(old_target != NULL); | 841 EXPECT_TRUE(old_target != NULL); |
| 842 | 842 |
| 843 browser()->ShowFindBar(); | 843 browser()->ShowFindBar(); |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 ui_test_utils::RunAllPendingInMessageLoop(); // Needed on Linux. | 1244 ui_test_utils::RunAllPendingInMessageLoop(); // Needed on Linux. |
| 1245 EXPECT_TRUE(GetFindBarWindowInfo(&position, NULL)); | 1245 EXPECT_TRUE(GetFindBarWindowInfo(&position, NULL)); |
| 1246 | 1246 |
| 1247 ui_test_utils::NavigateToURLWithDisposition( | 1247 ui_test_utils::NavigateToURLWithDisposition( |
| 1248 browser(), url, NEW_FOREGROUND_TAB, | 1248 browser(), url, NEW_FOREGROUND_TAB, |
| 1249 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 1249 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 1250 browser()->CloseTab(); | 1250 browser()->CloseTab(); |
| 1251 EXPECT_TRUE(GetFindBarWindowInfo(&position2, NULL)); | 1251 EXPECT_TRUE(GetFindBarWindowInfo(&position2, NULL)); |
| 1252 EXPECT_EQ(position, position2); | 1252 EXPECT_EQ(position, position2); |
| 1253 } | 1253 } |
| OLD | NEW |