| 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 | 10 |
| 10 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
| 11 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 14 #include "base/metrics/user_metrics.h" | 15 #include "base/metrics/user_metrics.h" |
| 15 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 17 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 166 |
| 166 OmniboxEditModel::State::~State() { | 167 OmniboxEditModel::State::~State() { |
| 167 } | 168 } |
| 168 | 169 |
| 169 | 170 |
| 170 // OmniboxEditModel ----------------------------------------------------------- | 171 // OmniboxEditModel ----------------------------------------------------------- |
| 171 | 172 |
| 172 OmniboxEditModel::OmniboxEditModel(OmniboxView* view, | 173 OmniboxEditModel::OmniboxEditModel(OmniboxView* view, |
| 173 OmniboxEditController* controller, | 174 OmniboxEditController* controller, |
| 174 scoped_ptr<OmniboxClient> client) | 175 scoped_ptr<OmniboxClient> client) |
| 175 : client_(client.Pass()), | 176 : client_(std::move(client)), |
| 176 view_(view), | 177 view_(view), |
| 177 controller_(controller), | 178 controller_(controller), |
| 178 focus_state_(OMNIBOX_FOCUS_NONE), | 179 focus_state_(OMNIBOX_FOCUS_NONE), |
| 179 focus_source_(INVALID), | 180 focus_source_(INVALID), |
| 180 user_input_in_progress_(false), | 181 user_input_in_progress_(false), |
| 181 user_input_since_focus_(true), | 182 user_input_since_focus_(true), |
| 182 just_deleted_text_(false), | 183 just_deleted_text_(false), |
| 183 has_temporary_text_(false), | 184 has_temporary_text_(false), |
| 184 paste_state_(NONE), | 185 paste_state_(NONE), |
| 185 control_key_state_(UP), | 186 control_key_state_(UP), |
| (...skipping 1274 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 | 1461 // Update state and notify view if the omnibox has focus and the caret |
| 1461 // visibility changed. | 1462 // visibility changed. |
| 1462 const bool was_caret_visible = is_caret_visible(); | 1463 const bool was_caret_visible = is_caret_visible(); |
| 1463 focus_state_ = state; | 1464 focus_state_ = state; |
| 1464 if (focus_state_ != OMNIBOX_FOCUS_NONE && | 1465 if (focus_state_ != OMNIBOX_FOCUS_NONE && |
| 1465 is_caret_visible() != was_caret_visible) | 1466 is_caret_visible() != was_caret_visible) |
| 1466 view_->ApplyCaretVisibility(); | 1467 view_->ApplyCaretVisibility(); |
| 1467 | 1468 |
| 1468 client_->OnFocusChanged(focus_state_, reason); | 1469 client_->OnFocusChanged(focus_state_, reason); |
| 1469 } | 1470 } |
| OLD | NEW |