| 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 "chrome_frame/find_dialog.h" | 5 #include "chrome_frame/find_dialog.h" |
| 6 | 6 |
| 7 #include <Richedit.h> | 7 #include <Richedit.h> |
| 8 | 8 |
| 9 #include "chrome_frame/chrome_frame_automation.h" | 9 #include "chrome_frame/chrome_frame_automation.h" |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 LRESULT CFFindDialog::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, | 44 LRESULT CFFindDialog::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, |
| 45 BOOL& bHandled) { | 45 BOOL& bHandled) { |
| 46 DestroyWindow(); | 46 DestroyWindow(); |
| 47 return 0; | 47 return 0; |
| 48 } | 48 } |
| 49 | 49 |
| 50 LRESULT CFFindDialog::OnInitDialog(UINT msg, WPARAM wparam, LPARAM lparam, | 50 LRESULT CFFindDialog::OnInitDialog(UINT msg, WPARAM wparam, LPARAM lparam, |
| 51 BOOL& handled) { | 51 BOOL& handled) { |
| 52 // Init() must be called before Create() or DoModal()! | 52 // Init() must be called before Create() or DoModal()! |
| 53 DCHECK(automation_client_); | 53 DCHECK(automation_client_.get()); |
| 54 | 54 |
| 55 InstallMessageHook(); | 55 InstallMessageHook(); |
| 56 SendDlgItemMessage(IDC_FIND_TEXT, EM_EXLIMITTEXT, 0, kMaxFindChars); | 56 SendDlgItemMessage(IDC_FIND_TEXT, EM_EXLIMITTEXT, 0, kMaxFindChars); |
| 57 BOOL result = CheckRadioButton(IDC_DIRECTION_DOWN, IDC_DIRECTION_UP, | 57 BOOL result = CheckRadioButton(IDC_DIRECTION_DOWN, IDC_DIRECTION_UP, |
| 58 IDC_DIRECTION_DOWN); | 58 IDC_DIRECTION_DOWN); |
| 59 | 59 |
| 60 HWND text_field = GetDlgItem(IDC_FIND_TEXT); | 60 HWND text_field = GetDlgItem(IDC_FIND_TEXT); |
| 61 ::SetFocus(text_field); | 61 ::SetFocus(text_field); |
| 62 | 62 |
| 63 return FALSE; // we set the focus ourselves. | 63 return FALSE; // we set the focus ourselves. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool CFFindDialog::UninstallMessageHook() { | 100 bool CFFindDialog::UninstallMessageHook() { |
| 101 DCHECK(msg_hook_ != NULL); | 101 DCHECK(msg_hook_ != NULL); |
| 102 BOOL result = ::UnhookWindowsHookEx(msg_hook_); | 102 BOOL result = ::UnhookWindowsHookEx(msg_hook_); |
| 103 DCHECK(result); | 103 DCHECK(result); |
| 104 msg_hook_ = NULL; | 104 msg_hook_ = NULL; |
| 105 | 105 |
| 106 return result != FALSE; | 106 return result != FALSE; |
| 107 } | 107 } |
| OLD | NEW |