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

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

Issue 62067: Commits bug issuereview 62043 (http://codereview.chromium.org/62043)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 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/controls/text_field.h" 5 #include "chrome/views/controls/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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 GetSel(start, end); 336 GetSel(start, end);
337 337
338 // Grab the selected text. 338 // Grab the selected text.
339 std::wstring str; 339 std::wstring str;
340 GetSelText(WriteInto(&str, end - start + 1)); 340 GetSelText(WriteInto(&str, end - start + 1));
341 341
342 return str; 342 return str;
343 } 343 }
344 344
345 void TextField::Edit::SelectAll() { 345 void TextField::Edit::SelectAll() {
346 // Using (0, -1) here is equivalent to calling SetSelAll(); both will select 346 // Select from the end to the front so that the first part of the text is
347 // the "phantom newline" that we're trying to avoid. 347 // always visible.
348 SetSel(0, GetTextLength()); 348 SetSel(GetTextLength(), 0);
349 } 349 }
350 350
351 void TextField::Edit::ClearSelection() { 351 void TextField::Edit::ClearSelection() {
352 SetSel(GetTextLength(), GetTextLength()); 352 SetSel(GetTextLength(), GetTextLength());
353 } 353 }
354 354
355 void TextField::Edit::RemoveBorder() { 355 void TextField::Edit::RemoveBorder() {
356 if (!draw_border_) 356 if (!draw_border_)
357 return; 357 return;
358 358
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 1126
1127 COLORREF bg_color; 1127 COLORREF bg_color;
1128 if (!use_default_background_color_) 1128 if (!use_default_background_color_)
1129 bg_color = skia::SkColorToCOLORREF(background_color_); 1129 bg_color = skia::SkColorToCOLORREF(background_color_);
1130 else 1130 else
1131 bg_color = GetSysColor(read_only_ ? COLOR_3DFACE : COLOR_WINDOW); 1131 bg_color = GetSysColor(read_only_ ? COLOR_3DFACE : COLOR_WINDOW);
1132 edit_->SetBackgroundColor(bg_color); 1132 edit_->SetBackgroundColor(bg_color);
1133 } 1133 }
1134 1134
1135 } // namespace views 1135 } // 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