OLD | NEW |
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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 } | 566 } |
567 | 567 |
568 void Textfield::SetAccessibleName(const base::string16& name) { | 568 void Textfield::SetAccessibleName(const base::string16& name) { |
569 accessible_name_ = name; | 569 accessible_name_ = name; |
570 } | 570 } |
571 | 571 |
572 void Textfield::ExecuteCommand(int command_id) { | 572 void Textfield::ExecuteCommand(int command_id) { |
573 ExecuteCommand(command_id, ui::EF_NONE); | 573 ExecuteCommand(command_id, ui::EF_NONE); |
574 } | 574 } |
575 | 575 |
576 void Textfield::SetFocusPainter(std::unique_ptr<Painter> focus_painter) { | |
577 focus_painter_ = std::move(focus_painter); | |
578 } | |
579 | |
580 bool Textfield::HasTextBeingDragged() { | 576 bool Textfield::HasTextBeingDragged() { |
581 return initiating_drag_; | 577 return initiating_drag_; |
582 } | 578 } |
583 | 579 |
584 //////////////////////////////////////////////////////////////////////////////// | 580 //////////////////////////////////////////////////////////////////////////////// |
585 // Textfield, View overrides: | 581 // Textfield, View overrides: |
586 | 582 |
587 gfx::Insets Textfield::GetInsets() const { | 583 gfx::Insets Textfield::GetInsets() const { |
588 gfx::Insets insets = View::GetInsets(); | 584 gfx::Insets insets = View::GetInsets(); |
589 insets += gfx::Insets(kTextPadding, kTextPadding, kTextPadding, kTextPadding); | 585 insets += gfx::Insets(kTextPadding, kTextPadding, kTextPadding, kTextPadding); |
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 RequestFocus(); | 1925 RequestFocus(); |
1930 model_->MoveCursorTo(mouse); | 1926 model_->MoveCursorTo(mouse); |
1931 if (!selection_clipboard_text.empty()) { | 1927 if (!selection_clipboard_text.empty()) { |
1932 model_->InsertText(selection_clipboard_text); | 1928 model_->InsertText(selection_clipboard_text); |
1933 UpdateAfterChange(true, true); | 1929 UpdateAfterChange(true, true); |
1934 } | 1930 } |
1935 OnAfterUserAction(); | 1931 OnAfterUserAction(); |
1936 } | 1932 } |
1937 | 1933 |
1938 } // namespace views | 1934 } // namespace views |
OLD | NEW |