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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 return; | 503 return; |
504 | 504 |
505 user_input_in_progress_ = in_progress; | 505 user_input_in_progress_ = in_progress; |
506 if (user_input_in_progress_) { | 506 if (user_input_in_progress_) { |
507 time_user_first_modified_omnibox_ = base::TimeTicks::Now(); | 507 time_user_first_modified_omnibox_ = base::TimeTicks::Now(); |
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, it hides the chip when user input begins. | 513 // * For HIDE_ON_USER_INPUT and ON_SRP, it hides the chip when user input |
| 514 // begins. |
514 // * 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 |
515 // 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 |
516 // acting like HIDE_ON_USER_INPUT. | 517 // acting like HIDE_ON_USER_INPUT. |
517 if (chrome::ShouldDisplayOriginChipV2() && in_progress) | 518 if (chrome::ShouldDisplayOriginChipV2() && in_progress) |
518 controller()->GetToolbarModel()->set_origin_chip_enabled(false); | 519 controller()->GetToolbarModel()->set_origin_chip_enabled(false); |
519 | 520 |
520 controller_->GetToolbarModel()->set_input_in_progress(in_progress); | 521 controller_->GetToolbarModel()->set_input_in_progress(in_progress); |
521 controller_->Update(NULL); | 522 controller_->Update(NULL); |
522 | 523 |
523 if (user_input_in_progress_ || !in_revert_) | 524 if (user_input_in_progress_ || !in_revert_) |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 // 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 |
1456 // visibility changed. | 1457 // visibility changed. |
1457 const bool was_caret_visible = is_caret_visible(); | 1458 const bool was_caret_visible = is_caret_visible(); |
1458 focus_state_ = state; | 1459 focus_state_ = state; |
1459 if (focus_state_ != OMNIBOX_FOCUS_NONE && | 1460 if (focus_state_ != OMNIBOX_FOCUS_NONE && |
1460 is_caret_visible() != was_caret_visible) | 1461 is_caret_visible() != was_caret_visible) |
1461 view_->ApplyCaretVisibility(); | 1462 view_->ApplyCaretVisibility(); |
1462 | 1463 |
1463 delegate_->OnFocusChanged(focus_state_, reason); | 1464 delegate_->OnFocusChanged(focus_state_, reason); |
1464 } | 1465 } |
OLD | NEW |