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

Unified Diff: views/controls/textfield/native_textfield_win.cc

Issue 200045: Use Scoped[Bstr,ComPtr,Variant] instead of their ATL equivalents to reduce de... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months 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
Index: views/controls/textfield/native_textfield_win.cc
===================================================================
--- views/controls/textfield/native_textfield_win.cc (revision 25862)
+++ views/controls/textfield/native_textfield_win.cc (working copy)
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
#include "app/win_util.h"
@@ -94,9 +96,9 @@
}
// Set up the text_object_model_.
- CComPtr<IRichEditOle> ole_interface;
+ ScopedComPtr<IRichEditOle, &IID_IRichEditOle> ole_interface;
ole_interface.Attach(GetOleInterface());
- text_object_model_ = ole_interface;
+ text_object_model_.QueryFrom(ole_interface);
}
NativeTextfieldWin::~NativeTextfieldWin() {
@@ -305,7 +307,9 @@
ReplaceSel(L"", true);
}
-LRESULT NativeTextfieldWin::OnImeChar(UINT message, WPARAM wparam, LPARAM lparam) {
+LRESULT NativeTextfieldWin::OnImeChar(UINT message,
+ WPARAM wparam,
+ LPARAM lparam) {
// http://crbug.com/7707: a rich-edit control may crash when it receives a
// WM_IME_CHAR message while it is processing a WM_IME_COMPOSITION message.
// Since view controls don't need WM_IME_CHAR messages, we prevent WM_IME_CHAR
@@ -512,7 +516,7 @@
// applicable.
if (views::RerouteMouseWheel(m_hWnd, w_param, l_param))
return 0;
- return DefWindowProc(message, w_param, l_param);;
+ return DefWindowProc(message, w_param, l_param);
}
void NativeTextfieldWin::OnMouseMove(UINT keys, const CPoint& point) {
@@ -842,9 +846,9 @@
ITextDocument* NativeTextfieldWin::GetTextObjectModel() const {
if (!text_object_model_) {
- CComPtr<IRichEditOle> ole_interface;
+ ScopedComPtr<IRichEditOle, &IID_IRichEditOle> ole_interface;
ole_interface.Attach(GetOleInterface());
- text_object_model_ = ole_interface;
+ text_object_model_.QueryFrom(ole_interface);
}
return text_object_model_;
}

Powered by Google App Engine
This is Rietveld 408576698