| 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 "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 5 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 content::RecordAction(base::UserMetricsAction("OmniboxInputInProgress")); | 508 content::RecordAction(base::UserMetricsAction("OmniboxInputInProgress")); |
| 509 autocomplete_controller()->ResetSession(); | 509 autocomplete_controller()->ResetSession(); |
| 510 } | 510 } |
| 511 | 511 |
| 512 // The following code handles two cases: | 512 // The following code handles two cases: |
| 513 // * For HIDE_ON_USER_INPUT and ON_SRP, it hides the chip when user input | 513 // * For HIDE_ON_USER_INPUT and ON_SRP, it hides the chip when user input |
| 514 // begins. | 514 // begins. |
| 515 // * For HIDE_ON_MOUSE_RELEASE, which only hides the chip on mouse release if | 515 // * For HIDE_ON_MOUSE_RELEASE, which only hides the chip on mouse release if |
| 516 // the omnibox is empty, it handles the "omnibox was not empty" case by | 516 // the omnibox is empty, it handles the "omnibox was not empty" case by |
| 517 // acting like HIDE_ON_USER_INPUT. | 517 // acting like HIDE_ON_USER_INPUT. |
| 518 if (chrome::ShouldDisplayOriginChipV2() && in_progress) | 518 if (chrome::ShouldDisplayOriginChip() && in_progress) |
| 519 controller()->GetToolbarModel()->set_origin_chip_enabled(false); | 519 controller()->GetToolbarModel()->set_origin_chip_enabled(false); |
| 520 | 520 |
| 521 controller_->GetToolbarModel()->set_input_in_progress(in_progress); | 521 controller_->GetToolbarModel()->set_input_in_progress(in_progress); |
| 522 controller_->Update(NULL); | 522 controller_->Update(NULL); |
| 523 | 523 |
| 524 if (user_input_in_progress_ || !in_revert_) | 524 if (user_input_in_progress_ || !in_revert_) |
| 525 delegate_->OnInputStateChanged(); | 525 delegate_->OnInputStateChanged(); |
| 526 } | 526 } |
| 527 | 527 |
| 528 void OmniboxEditModel::Revert() { | 528 void OmniboxEditModel::Revert() { |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1456 // Update state and notify view if the omnibox has focus and the caret | 1456 // Update state and notify view if the omnibox has focus and the caret |
| 1457 // visibility changed. | 1457 // visibility changed. |
| 1458 const bool was_caret_visible = is_caret_visible(); | 1458 const bool was_caret_visible = is_caret_visible(); |
| 1459 focus_state_ = state; | 1459 focus_state_ = state; |
| 1460 if (focus_state_ != OMNIBOX_FOCUS_NONE && | 1460 if (focus_state_ != OMNIBOX_FOCUS_NONE && |
| 1461 is_caret_visible() != was_caret_visible) | 1461 is_caret_visible() != was_caret_visible) |
| 1462 view_->ApplyCaretVisibility(); | 1462 view_->ApplyCaretVisibility(); |
| 1463 | 1463 |
| 1464 delegate_->OnFocusChanged(focus_state_, reason); | 1464 delegate_->OnFocusChanged(focus_state_, reason); |
| 1465 } | 1465 } |
| OLD | NEW |