OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/native_textfield_views.h" | 5 #include "ui/views/controls/textfield/native_textfield_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 const string16 original_text = GetText(); | 1390 const string16 original_text = GetText(); |
1391 const bool success = model_->Paste(); | 1391 const bool success = model_->Paste(); |
1392 | 1392 |
1393 if (success) { | 1393 if (success) { |
1394 // As Paste is handled in model_->Paste(), the RenderText may contain | 1394 // As Paste is handled in model_->Paste(), the RenderText may contain |
1395 // upper case characters. This is not consistent with other places | 1395 // upper case characters. This is not consistent with other places |
1396 // which keeps RenderText only containing lower case characters. | 1396 // which keeps RenderText only containing lower case characters. |
1397 string16 new_text = GetTextForDisplay(GetText()); | 1397 string16 new_text = GetTextForDisplay(GetText()); |
1398 model_->SetText(new_text); | 1398 model_->SetText(new_text); |
1399 | 1399 |
1400 // Calls TextfieldController::ContentsChanged() explicitly if the paste | 1400 TextfieldController* controller = textfield_->GetController(); |
1401 // action did not change the content at all. See http://crbug.com/79002 | 1401 if (controller) { |
1402 if (new_text == original_text) { | 1402 // Calls TextfieldController::ContentsChanged() explicitly if the paste |
1403 TextfieldController* controller = textfield_->GetController(); | 1403 // action did not change the content at all. See http://crbug.com/79002 |
1404 if (controller) | 1404 if (new_text == original_text) |
1405 controller->ContentsChanged(textfield_, textfield_->text()); | 1405 controller->ContentsChanged(textfield_, textfield_->text()); |
| 1406 controller->OnAfterPaste(); |
1406 } | 1407 } |
1407 } | 1408 } |
1408 return success; | 1409 return success; |
1409 } | 1410 } |
1410 | 1411 |
1411 void NativeTextfieldViews::TrackMouseClicks(const ui::MouseEvent& event) { | 1412 void NativeTextfieldViews::TrackMouseClicks(const ui::MouseEvent& event) { |
1412 if (event.IsOnlyLeftMouseButton()) { | 1413 if (event.IsOnlyLeftMouseButton()) { |
1413 base::TimeDelta time_delta = event.time_stamp() - last_click_time_; | 1414 base::TimeDelta time_delta = event.time_stamp() - last_click_time_; |
1414 if (time_delta.InMilliseconds() <= GetDoubleClickInterval() && | 1415 if (time_delta.InMilliseconds() <= GetDoubleClickInterval() && |
1415 !ExceededDragThresholdFromLastClickLocation(event)) { | 1416 !ExceededDragThresholdFromLastClickLocation(event)) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1482 | 1483 |
1483 void NativeTextfieldViews::PlatformGestureEventHandling( | 1484 void NativeTextfieldViews::PlatformGestureEventHandling( |
1484 const ui::GestureEvent* event) { | 1485 const ui::GestureEvent* event) { |
1485 #if defined(OS_WIN) && defined(USE_AURA) | 1486 #if defined(OS_WIN) && defined(USE_AURA) |
1486 if (event->type() == ui::ET_GESTURE_TAP_DOWN && !textfield_->read_only()) | 1487 if (event->type() == ui::ET_GESTURE_TAP_DOWN && !textfield_->read_only()) |
1487 base::win::DisplayVirtualKeyboard(); | 1488 base::win::DisplayVirtualKeyboard(); |
1488 #endif | 1489 #endif |
1489 } | 1490 } |
1490 | 1491 |
1491 } // namespace views | 1492 } // namespace views |
OLD | NEW |