| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/find_bar_win.h" | 5 #include "chrome/browser/views/find_bar_win.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/find_notification_details.h" | 9 #include "chrome/browser/find_notification_details.h" |
| 10 #include "chrome/browser/render_view_host.h" | 10 #include "chrome/browser/render_view_host.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 307 |
| 308 void FindBarWin::SetParent(HWND new_parent) { | 308 void FindBarWin::SetParent(HWND new_parent) { |
| 309 DCHECK(new_parent); | 309 DCHECK(new_parent); |
| 310 if (parent_hwnd_ != new_parent) { | 310 if (parent_hwnd_ != new_parent) { |
| 311 // Sync up the focus listener with the new focus manager. | 311 // Sync up the focus listener with the new focus manager. |
| 312 SetFocusChangeListener(new_parent); | 312 SetFocusChangeListener(new_parent); |
| 313 | 313 |
| 314 parent_hwnd_ = new_parent; | 314 parent_hwnd_ = new_parent; |
| 315 ::SetParent(GetHWND(), new_parent); | 315 ::SetParent(GetHWND(), new_parent); |
| 316 | 316 |
| 317 gfx::Rect new_pos = GetDialogPosition(gfx::Rect()); |
| 318 SetDialogPosition(new_pos); |
| 319 |
| 317 // The MSDN documentation specifies that you need to manually update the | 320 // The MSDN documentation specifies that you need to manually update the |
| 318 // UI state after changing the parent. | 321 // UI state after changing the parent. |
| 319 ::SendMessage(new_parent, | 322 ::SendMessage(new_parent, |
| 320 WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, 0), 0); | 323 WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, 0), 0); |
| 321 | 324 |
| 322 // We have a new focus manager now, so start tracking with that. | 325 // We have a new focus manager now, so start tracking with that. |
| 323 focus_tracker_.reset(new views::ExternalFocusTracker(view_, | 326 focus_tracker_.reset(new views::ExternalFocusTracker(view_, |
| 324 focus_manager_)); | 327 focus_manager_)); |
| 325 } | 328 } |
| 326 } | 329 } |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 // TODO(finnur): Once we fix issue 1307173 we should not remember any old | 684 // TODO(finnur): Once we fix issue 1307173 we should not remember any old |
| 682 // accelerator targets and just Register and Unregister when needed. | 685 // accelerator targets and just Register and Unregister when needed. |
| 683 DCHECK(old_accel_target_for_esc_ != NULL); | 686 DCHECK(old_accel_target_for_esc_ != NULL); |
| 684 views::Accelerator escape(VK_ESCAPE, false, false, false); | 687 views::Accelerator escape(VK_ESCAPE, false, false, false); |
| 685 views::AcceleratorTarget* current_target = | 688 views::AcceleratorTarget* current_target = |
| 686 focus_manager_->GetTargetForAccelerator(escape); | 689 focus_manager_->GetTargetForAccelerator(escape); |
| 687 if (current_target == this) | 690 if (current_target == this) |
| 688 focus_manager_->RegisterAccelerator(escape, old_accel_target_for_esc_); | 691 focus_manager_->RegisterAccelerator(escape, old_accel_target_for_esc_); |
| 689 } | 692 } |
| 690 | 693 |
| OLD | NEW |