Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5802)

Unified Diff: chrome_frame/find_dialog.cc

Issue 386014: The ChromeFrameAutomationClient class needs to be refcounted as it implements... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/find_dialog.h ('k') | chrome_frame/np_proxy_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/find_dialog.cc
===================================================================
--- chrome_frame/find_dialog.cc (revision 31733)
+++ chrome_frame/find_dialog.cc (working copy)
@@ -50,7 +50,7 @@
LRESULT CFFindDialog::OnInitDialog(UINT msg, WPARAM wparam, LPARAM lparam,
BOOL& handled) {
// Init() must be called before Create() or DoModal()!
- DCHECK(automation_client_);
+ DCHECK(automation_client_.get());
InstallMessageHook();
SendDlgItemMessage(IDC_FIND_TEXT, EM_EXLIMITTEXT, 0, kMaxFindChars);
@@ -67,32 +67,32 @@
LPARAM lparam) {
// Mostly borrowed from http://support.microsoft.com/kb/q187988/
// and http://www.codeproject.com/KB/atl/cdialogmessagehook.aspx.
- LPMSG msg = reinterpret_cast<LPMSG>(lparam);
- if (code >= 0 && wparam == PM_REMOVE &&
- msg->message >= WM_KEYFIRST && msg->message <= WM_KEYLAST) {
- HWND hwnd = GetActiveWindow();
- if (::IsWindow(hwnd) && ::IsDialogMessage(hwnd, msg)) {
- // The value returned from this hookproc is ignored, and it cannot
- // be used to tell Windows the message has been handled. To avoid
- // further processing, convert the message to WM_NULL before
- // returning.
- msg->hwnd = NULL;
- msg->message = WM_NULL;
- msg->lParam = 0L;
- msg->wParam = 0;
- }
- }
-
- // Passes the hook information to the next hook procedure in
- // the current hook chain.
+ LPMSG msg = reinterpret_cast<LPMSG>(lparam);
+ if (code >= 0 && wparam == PM_REMOVE &&
+ msg->message >= WM_KEYFIRST && msg->message <= WM_KEYLAST) {
+ HWND hwnd = GetActiveWindow();
+ if (::IsWindow(hwnd) && ::IsDialogMessage(hwnd, msg)) {
+ // The value returned from this hookproc is ignored, and it cannot
+ // be used to tell Windows the message has been handled. To avoid
+ // further processing, convert the message to WM_NULL before
+ // returning.
+ msg->hwnd = NULL;
+ msg->message = WM_NULL;
+ msg->lParam = 0L;
+ msg->wParam = 0;
+ }
+ }
+
+ // Passes the hook information to the next hook procedure in
+ // the current hook chain.
return ::CallNextHookEx(msg_hook_, code, wparam, lparam);
}
bool CFFindDialog::InstallMessageHook() {
// Make sure we only call this once.
DCHECK(msg_hook_ == NULL);
- msg_hook_ = ::SetWindowsHookEx(WH_GETMESSAGE, &CFFindDialog::GetMsgProc,
- _AtlBaseModule.m_hInst, GetCurrentThreadId());
+ msg_hook_ = ::SetWindowsHookEx(WH_GETMESSAGE, &CFFindDialog::GetMsgProc,
+ _AtlBaseModule.m_hInst, GetCurrentThreadId());
DCHECK(msg_hook_ != NULL);
return msg_hook_ != NULL;
}
Property changes on: chrome_frame\find_dialog.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome_frame/find_dialog.h ('k') | chrome_frame/np_proxy_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698