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