| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/keyboard_codes.h" | 5 #include "app/keyboard_codes.h" | 
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.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/browser.h" | 9 #include "chrome/browser/browser.h" | 
| 10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" | 
| 11 #include "chrome/browser/find_bar.h" | 11 #include "chrome/browser/find_bar.h" | 
| 12 #include "chrome/browser/find_bar_controller.h" | 12 #include "chrome/browser/find_bar_controller.h" | 
| 13 #include "chrome/browser/find_notification_details.h" | 13 #include "chrome/browser/find_notification_details.h" | 
| 14 #include "chrome/browser/profile.h" | 14 #include "chrome/browser/profile.h" | 
| 15 #include "chrome/browser/renderer_host/render_view_host.h" | 15 #include "chrome/browser/renderer_host/render_view_host.h" | 
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 714 | 714 | 
| 715   // First we navigate to any page. | 715   // First we navigate to any page. | 
| 716   GURL url = test_server()->GetURL(kSimplePage); | 716   GURL url = test_server()->GetURL(kSimplePage); | 
| 717   ui_test_utils::NavigateToURL(browser(), url); | 717   ui_test_utils::NavigateToURL(browser(), url); | 
| 718 | 718 | 
| 719   views::FocusManager* focus_manager = | 719   views::FocusManager* focus_manager = | 
| 720       views::FocusManager::GetFocusManagerForNativeWindow( | 720       views::FocusManager::GetFocusManagerForNativeWindow( | 
| 721           browser()->window()->GetNativeHandle()); | 721           browser()->window()->GetNativeHandle()); | 
| 722 | 722 | 
| 723   // See where Escape is registered. | 723   // See where Escape is registered. | 
| 724   views::Accelerator escape(base::VKEY_ESCAPE, false, false, false); | 724   views::Accelerator escape(app::VKEY_ESCAPE, false, false, false); | 
| 725   views::AcceleratorTarget* old_target = | 725   views::AcceleratorTarget* old_target = | 
| 726       focus_manager->GetCurrentTargetForAccelerator(escape); | 726       focus_manager->GetCurrentTargetForAccelerator(escape); | 
| 727   EXPECT_TRUE(old_target != NULL); | 727   EXPECT_TRUE(old_target != NULL); | 
| 728 | 728 | 
| 729   browser()->ShowFindBar(); | 729   browser()->ShowFindBar(); | 
| 730 | 730 | 
| 731   // Our Find bar should be the new target. | 731   // Our Find bar should be the new target. | 
| 732   views::AcceleratorTarget* new_target = | 732   views::AcceleratorTarget* new_target = | 
| 733       focus_manager->GetCurrentTargetForAccelerator(escape); | 733       focus_manager->GetCurrentTargetForAccelerator(escape); | 
| 734 | 734 | 
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1074 | 1074 | 
| 1075   TabContents* tab = browser()->GetSelectedTabContents(); | 1075   TabContents* tab = browser()->GetSelectedTabContents(); | 
| 1076   int ordinal = 0; | 1076   int ordinal = 0; | 
| 1077   FindInPageWchar(tab, L"link", kFwd, kIgnoreCase, &ordinal); | 1077   FindInPageWchar(tab, L"link", kFwd, kIgnoreCase, &ordinal); | 
| 1078   EXPECT_EQ(ordinal, 1); | 1078   EXPECT_EQ(ordinal, 1); | 
| 1079 | 1079 | 
| 1080   // End the find session, click on the link. | 1080   // End the find session, click on the link. | 
| 1081   tab->StopFinding(FindBarController::kActivateSelection); | 1081   tab->StopFinding(FindBarController::kActivateSelection); | 
| 1082   EXPECT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); | 1082   EXPECT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); | 
| 1083 } | 1083 } | 
| OLD | NEW | 
|---|