| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "chrome/browser/browser.h" | 6 #include "chrome/browser/browser.h" |
| 7 #include "chrome/browser/browser_window.h" | 7 #include "chrome/browser/browser_window.h" |
| 8 #include "chrome/browser/find_bar_controller.h" | 8 #include "chrome/browser/find_bar_controller.h" |
| 9 #include "chrome/browser/find_notification_details.h" | 9 #include "chrome/browser/find_notification_details.h" |
| 10 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 } | 550 } |
| 551 | 551 |
| 552 // Make sure Find box grabs the Esc accelerator and restores it again. | 552 // Make sure Find box grabs the Esc accelerator and restores it again. |
| 553 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, AcceleratorRestoring) { | 553 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, AcceleratorRestoring) { |
| 554 HTTPTestServer* server = StartHTTPServer(); | 554 HTTPTestServer* server = StartHTTPServer(); |
| 555 | 555 |
| 556 // First we navigate to any page. | 556 // First we navigate to any page. |
| 557 GURL url = server->TestServerPageW(kSimplePage); | 557 GURL url = server->TestServerPageW(kSimplePage); |
| 558 ui_test_utils::NavigateToURL(browser(), url); | 558 ui_test_utils::NavigateToURL(browser(), url); |
| 559 | 559 |
| 560 gfx::NativeView browser_view = browser()->window()->GetNativeHandle(); | 560 views::FocusManager* focus_manager = views::FocusManager::GetFocusManager( |
| 561 views::FocusManager* focus_manager = | 561 browser()->window()->GetNativeHandle()); |
| 562 views::FocusManager::GetFocusManagerForNativeView(browser_view); | |
| 563 | 562 |
| 564 // See where Escape is registered. | 563 // See where Escape is registered. |
| 565 views::Accelerator escape(VK_ESCAPE, false, false, false); | 564 views::Accelerator escape(VK_ESCAPE, false, false, false); |
| 566 views::AcceleratorTarget* old_target = | 565 views::AcceleratorTarget* old_target = |
| 567 focus_manager->GetCurrentTargetForAccelerator(escape); | 566 focus_manager->GetCurrentTargetForAccelerator(escape); |
| 568 EXPECT_TRUE(old_target != NULL); | 567 EXPECT_TRUE(old_target != NULL); |
| 569 | 568 |
| 570 // Open the Find box. | 569 // Open the Find box. |
| 571 browser()->ShowFindBar(); | 570 browser()->ShowFindBar(); |
| 572 | 571 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 602 // backspace, but that's been proven flaky in the past, so we go straight to | 601 // backspace, but that's been proven flaky in the past, so we go straight to |
| 603 // tab_contents. | 602 // tab_contents. |
| 604 TabContents* tab_contents = browser()->GetSelectedTabContents(); | 603 TabContents* tab_contents = browser()->GetSelectedTabContents(); |
| 605 // Stop the (non-existing) find operation, and clear the selection (which | 604 // Stop the (non-existing) find operation, and clear the selection (which |
| 606 // signals the UI is still active). | 605 // signals the UI is still active). |
| 607 tab_contents->StopFinding(true); | 606 tab_contents->StopFinding(true); |
| 608 // Make sure the Find UI flag hasn't been cleared, it must be so that the UI | 607 // Make sure the Find UI flag hasn't been cleared, it must be so that the UI |
| 609 // still responds to browser window resizing. | 608 // still responds to browser window resizing. |
| 610 ASSERT_TRUE(tab_contents->find_ui_active()); | 609 ASSERT_TRUE(tab_contents->find_ui_active()); |
| 611 } | 610 } |
| OLD | NEW |