| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 user_text(user_text), | 157 user_text(user_text), |
| 158 gray_text(gray_text), | 158 gray_text(gray_text), |
| 159 keyword(keyword), | 159 keyword(keyword), |
| 160 is_keyword_hint(is_keyword_hint), | 160 is_keyword_hint(is_keyword_hint), |
| 161 url_replacement_enabled(url_replacement_enabled), | 161 url_replacement_enabled(url_replacement_enabled), |
| 162 focus_state(focus_state), | 162 focus_state(focus_state), |
| 163 focus_source(focus_source), | 163 focus_source(focus_source), |
| 164 autocomplete_input(autocomplete_input) { | 164 autocomplete_input(autocomplete_input) { |
| 165 } | 165 } |
| 166 | 166 |
| 167 OmniboxEditModel::State::State(const State& other) = default; |
| 168 |
| 167 OmniboxEditModel::State::~State() { | 169 OmniboxEditModel::State::~State() { |
| 168 } | 170 } |
| 169 | 171 |
| 170 | 172 |
| 171 // OmniboxEditModel ----------------------------------------------------------- | 173 // OmniboxEditModel ----------------------------------------------------------- |
| 172 | 174 |
| 173 OmniboxEditModel::OmniboxEditModel(OmniboxView* view, | 175 OmniboxEditModel::OmniboxEditModel(OmniboxView* view, |
| 174 OmniboxEditController* controller, | 176 OmniboxEditController* controller, |
| 175 scoped_ptr<OmniboxClient> client) | 177 scoped_ptr<OmniboxClient> client) |
| 176 : client_(std::move(client)), | 178 : client_(std::move(client)), |
| (...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 // Update state and notify view if the omnibox has focus and the caret | 1463 // Update state and notify view if the omnibox has focus and the caret |
| 1462 // visibility changed. | 1464 // visibility changed. |
| 1463 const bool was_caret_visible = is_caret_visible(); | 1465 const bool was_caret_visible = is_caret_visible(); |
| 1464 focus_state_ = state; | 1466 focus_state_ = state; |
| 1465 if (focus_state_ != OMNIBOX_FOCUS_NONE && | 1467 if (focus_state_ != OMNIBOX_FOCUS_NONE && |
| 1466 is_caret_visible() != was_caret_visible) | 1468 is_caret_visible() != was_caret_visible) |
| 1467 view_->ApplyCaretVisibility(); | 1469 view_->ApplyCaretVisibility(); |
| 1468 | 1470 |
| 1469 client_->OnFocusChanged(focus_state_, reason); | 1471 client_->OnFocusChanged(focus_state_, reason); |
| 1470 } | 1472 } |
| OLD | NEW |