| 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 <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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 // in the omnibox and selecting paste in Linux (in which case we actually get | 941 // in the omnibox and selecting paste in Linux (in which case we actually get |
| 942 // the OnSetFocus() call after the process of handling the paste has kicked | 942 // the OnSetFocus() call after the process of handling the paste has kicked |
| 943 // off). | 943 // off). |
| 944 // TODO(hfung): Remove this when crbug/271590 is fixed. | 944 // TODO(hfung): Remove this when crbug/271590 is fixed. |
| 945 if (delegate_->CurrentPageExists() && !user_input_in_progress_) { | 945 if (delegate_->CurrentPageExists() && !user_input_in_progress_) { |
| 946 // TODO(jered): We may want to merge this into Start() and just call that | 946 // TODO(jered): We may want to merge this into Start() and just call that |
| 947 // here rather than having a special entry point for zero-suggest. Note | 947 // here rather than having a special entry point for zero-suggest. Note |
| 948 // that we avoid PermanentURL() here because it's not guaranteed to give us | 948 // that we avoid PermanentURL() here because it's not guaranteed to give us |
| 949 // the actual underlying current URL, e.g. if we're on the NTP and the | 949 // the actual underlying current URL, e.g. if we're on the NTP and the |
| 950 // |permanent_text_| is empty. | 950 // |permanent_text_| is empty. |
| 951 autocomplete_controller()->StartZeroSuggest(AutocompleteInput( | 951 autocomplete_controller()->StartOnOmniboxFocus(AutocompleteInput( |
| 952 permanent_text_, base::string16::npos, std::string(), | 952 permanent_text_, base::string16::npos, std::string(), |
| 953 delegate_->GetURL(), ClassifyPage(), false, false, true, true, | 953 delegate_->GetURL(), ClassifyPage(), false, false, true, true, |
| 954 ChromeAutocompleteSchemeClassifier(profile_))); | 954 ChromeAutocompleteSchemeClassifier(profile_))); |
| 955 } | 955 } |
| 956 | 956 |
| 957 if (user_input_in_progress_ || !in_revert_) | 957 if (user_input_in_progress_ || !in_revert_) |
| 958 delegate_->OnInputStateChanged(); | 958 delegate_->OnInputStateChanged(); |
| 959 } | 959 } |
| 960 | 960 |
| 961 void OmniboxEditModel::SetCaretVisibility(bool visible) { | 961 void OmniboxEditModel::SetCaretVisibility(bool visible) { |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1475 // Update state and notify view if the omnibox has focus and the caret | 1475 // Update state and notify view if the omnibox has focus and the caret |
| 1476 // visibility changed. | 1476 // visibility changed. |
| 1477 const bool was_caret_visible = is_caret_visible(); | 1477 const bool was_caret_visible = is_caret_visible(); |
| 1478 focus_state_ = state; | 1478 focus_state_ = state; |
| 1479 if (focus_state_ != OMNIBOX_FOCUS_NONE && | 1479 if (focus_state_ != OMNIBOX_FOCUS_NONE && |
| 1480 is_caret_visible() != was_caret_visible) | 1480 is_caret_visible() != was_caret_visible) |
| 1481 view_->ApplyCaretVisibility(); | 1481 view_->ApplyCaretVisibility(); |
| 1482 | 1482 |
| 1483 delegate_->OnFocusChanged(focus_state_, reason); | 1483 delegate_->OnFocusChanged(focus_state_, reason); |
| 1484 } | 1484 } |
| OLD | NEW |