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

Side by Side Diff: chrome/views/text_field.cc

Issue 21255: Fix focus problem with text field views (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/views/text_field.h" 5 #include "chrome/views/text_field.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlapp.h> 8 #include <atlapp.h>
9 #include <atlcrack.h> 9 #include <atlcrack.h>
10 #include <atlctrls.h> 10 #include <atlctrls.h>
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 void TextField::Edit::OnCopy() { 412 void TextField::Edit::OnCopy() {
413 const std::wstring text(GetSelectedText()); 413 const std::wstring text(GetSelectedText());
414 414
415 if (!text.empty()) { 415 if (!text.empty()) {
416 ScopedClipboardWriter scw(g_browser_process->clipboard_service()); 416 ScopedClipboardWriter scw(g_browser_process->clipboard_service());
417 scw.WriteText(text); 417 scw.WriteText(text);
418 } 418 }
419 } 419 }
420 420
421 LRESULT TextField::Edit::OnCreate(CREATESTRUCT* create_struct) { 421 LRESULT TextField::Edit::OnCreate(CREATESTRUCT* create_struct) {
422 SetMsgHandled(FALSE);
422 TRACK_HWND_CREATION(m_hWnd); 423 TRACK_HWND_CREATION(m_hWnd);
423 return 0; 424 return 0;
424 } 425 }
425 426
426 void TextField::Edit::OnCut() { 427 void TextField::Edit::OnCut() {
427 if (parent_->IsReadOnly()) 428 if (parent_->IsReadOnly())
428 return; 429 return;
429 430
430 OnCopy(); 431 OnCopy();
431 432
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 1115
1115 COLORREF bg_color; 1116 COLORREF bg_color;
1116 if (!use_default_background_color_) 1117 if (!use_default_background_color_)
1117 bg_color = skia::SkColorToCOLORREF(background_color_); 1118 bg_color = skia::SkColorToCOLORREF(background_color_);
1118 else 1119 else
1119 bg_color = GetSysColor(read_only_ ? COLOR_3DFACE : COLOR_WINDOW); 1120 bg_color = GetSysColor(read_only_ ? COLOR_3DFACE : COLOR_WINDOW);
1120 edit_->SetBackgroundColor(bg_color); 1121 edit_->SetBackgroundColor(bg_color);
1121 } 1122 }
1122 1123
1123 } // namespace views 1124 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698