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

Side by Side Diff: ui/views/controls/textfield/textfield.cc

Issue 1898633004: Views: Add new SetFocusBehavior method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/textfield/textfield.h" 5 #include "ui/views/controls/textfield/textfield.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 drop_cursor_visible_(false), 287 drop_cursor_visible_(false),
288 initiating_drag_(false), 288 initiating_drag_(false),
289 aggregated_clicks_(0), 289 aggregated_clicks_(0),
290 drag_start_display_offset_(0), 290 drag_start_display_offset_(0),
291 touch_handles_hidden_due_to_scroll_(false), 291 touch_handles_hidden_due_to_scroll_(false),
292 weak_ptr_factory_(this) { 292 weak_ptr_factory_(this) {
293 set_context_menu_controller(this); 293 set_context_menu_controller(this);
294 set_drag_controller(this); 294 set_drag_controller(this);
295 GetRenderText()->SetFontList(GetDefaultFontList()); 295 GetRenderText()->SetFontList(GetDefaultFontList());
296 SetBorder(std::unique_ptr<Border>(new FocusableBorder())); 296 SetBorder(std::unique_ptr<Border>(new FocusableBorder()));
297 SetFocusable(true); 297 SetFocusBehavior(FocusBehavior::ALWAYS);
298 298
299 if (ViewsDelegate::GetInstance()) { 299 if (ViewsDelegate::GetInstance()) {
300 password_reveal_duration_ = 300 password_reveal_duration_ =
301 ViewsDelegate::GetInstance() 301 ViewsDelegate::GetInstance()
302 ->GetDefaultTextfieldObscuredRevealDuration(); 302 ->GetDefaultTextfieldObscuredRevealDuration();
303 } 303 }
304 304
305 // These allow BrowserView to pass edit commands from the Chrome menu to us 305 // These allow BrowserView to pass edit commands from the Chrome menu to us
306 // when we're focused by simply asking the FocusManager to 306 // when we're focused by simply asking the FocusManager to
307 // ProcessAccelerator() with the relevant accelerators. 307 // ProcessAccelerator() with the relevant accelerators.
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1913 RequestFocus(); 1913 RequestFocus();
1914 model_->MoveCursorTo(mouse); 1914 model_->MoveCursorTo(mouse);
1915 if (!selection_clipboard_text.empty()) { 1915 if (!selection_clipboard_text.empty()) {
1916 model_->InsertText(selection_clipboard_text); 1916 model_->InsertText(selection_clipboard_text);
1917 UpdateAfterChange(true, true); 1917 UpdateAfterChange(true, true);
1918 } 1918 }
1919 OnAfterUserAction(); 1919 OnAfterUserAction();
1920 } 1920 }
1921 1921
1922 } // namespace views 1922 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/table/table_view.cc ('k') | ui/views/controls/textfield/textfield_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698