| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/omnibox/browser/omnibox_edit_model.h" | 5 #include "components/omnibox/browser/omnibox_edit_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 if (user_input_in_progress_ == in_progress) | 444 if (user_input_in_progress_ == in_progress) |
| 445 return; | 445 return; |
| 446 | 446 |
| 447 user_input_in_progress_ = in_progress; | 447 user_input_in_progress_ = in_progress; |
| 448 if (user_input_in_progress_) { | 448 if (user_input_in_progress_) { |
| 449 time_user_first_modified_omnibox_ = base::TimeTicks::Now(); | 449 time_user_first_modified_omnibox_ = base::TimeTicks::Now(); |
| 450 base::RecordAction(base::UserMetricsAction("OmniboxInputInProgress")); | 450 base::RecordAction(base::UserMetricsAction("OmniboxInputInProgress")); |
| 451 autocomplete_controller()->ResetSession(); | 451 autocomplete_controller()->ResetSession(); |
| 452 } | 452 } |
| 453 | 453 |
| 454 controller_->GetToolbarModel()->set_input_in_progress(in_progress); | 454 controller_->OnInputInProgress(in_progress); |
| 455 controller_->UpdateWithoutTabRestore(); | |
| 456 | 455 |
| 457 if (user_input_in_progress_ || !in_revert_) | 456 if (user_input_in_progress_ || !in_revert_) |
| 458 client_->OnInputStateChanged(); | 457 client_->OnInputStateChanged(); |
| 459 } | 458 } |
| 460 | 459 |
| 461 void OmniboxEditModel::Revert() { | 460 void OmniboxEditModel::Revert() { |
| 462 SetInputInProgress(false); | 461 SetInputInProgress(false); |
| 463 input_.Clear(); | 462 input_.Clear(); |
| 464 paste_state_ = NONE; | 463 paste_state_ = NONE; |
| 465 InternalSetUserText(base::string16()); | 464 InternalSetUserText(base::string16()); |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 // Update state and notify view if the omnibox has focus and the caret | 1459 // Update state and notify view if the omnibox has focus and the caret |
| 1461 // visibility changed. | 1460 // visibility changed. |
| 1462 const bool was_caret_visible = is_caret_visible(); | 1461 const bool was_caret_visible = is_caret_visible(); |
| 1463 focus_state_ = state; | 1462 focus_state_ = state; |
| 1464 if (focus_state_ != OMNIBOX_FOCUS_NONE && | 1463 if (focus_state_ != OMNIBOX_FOCUS_NONE && |
| 1465 is_caret_visible() != was_caret_visible) | 1464 is_caret_visible() != was_caret_visible) |
| 1466 view_->ApplyCaretVisibility(); | 1465 view_->ApplyCaretVisibility(); |
| 1467 | 1466 |
| 1468 client_->OnFocusChanged(focus_state_, reason); | 1467 client_->OnFocusChanged(focus_state_, reason); |
| 1469 } | 1468 } |
| OLD | NEW |