| 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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 bool keyword_is_selected = KeywordIsSelected(); | 488 bool keyword_is_selected = KeywordIsSelected(); |
| 489 omnibox_controller_->StartAutocomplete( | 489 omnibox_controller_->StartAutocomplete( |
| 490 user_text_, | 490 user_text_, |
| 491 cursor_position, | 491 cursor_position, |
| 492 current_url, | 492 current_url, |
| 493 ClassifyPage(), | 493 ClassifyPage(), |
| 494 prevent_inline_autocomplete || just_deleted_text_ || | 494 prevent_inline_autocomplete || just_deleted_text_ || |
| 495 (has_selected_text && inline_autocomplete_text_.empty()) || | 495 (has_selected_text && inline_autocomplete_text_.empty()) || |
| 496 (paste_state_ != NONE), | 496 (paste_state_ != NONE), |
| 497 keyword_is_selected, | 497 keyword_is_selected, |
| 498 keyword_is_selected || allow_exact_keyword_match_, | 498 keyword_is_selected || allow_exact_keyword_match_); |
| 499 controller_->GetOmniboxBounds().x()); | |
| 500 } | 499 } |
| 501 | 500 |
| 502 void OmniboxEditModel::StopAutocomplete() { | 501 void OmniboxEditModel::StopAutocomplete() { |
| 503 autocomplete_controller()->Stop(true); | 502 autocomplete_controller()->Stop(true); |
| 504 } | 503 } |
| 505 | 504 |
| 506 bool OmniboxEditModel::CanPasteAndGo(const string16& text) const { | 505 bool OmniboxEditModel::CanPasteAndGo(const string16& text) const { |
| 507 if (!view_->command_updater()->IsCommandEnabled(IDC_OPEN_CURRENT_URL)) | 506 if (!view_->command_updater()->IsCommandEnabled(IDC_OPEN_CURRENT_URL)) |
| 508 return false; | 507 return false; |
| 509 | 508 |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 instant->OmniboxFocusChanged(state, reason, NULL); | 1290 instant->OmniboxFocusChanged(state, reason, NULL); |
| 1292 | 1291 |
| 1293 // Update state and notify view if the omnibox has focus and the caret | 1292 // Update state and notify view if the omnibox has focus and the caret |
| 1294 // visibility changed. | 1293 // visibility changed. |
| 1295 const bool was_caret_visible = is_caret_visible(); | 1294 const bool was_caret_visible = is_caret_visible(); |
| 1296 focus_state_ = state; | 1295 focus_state_ = state; |
| 1297 if (focus_state_ != OMNIBOX_FOCUS_NONE && | 1296 if (focus_state_ != OMNIBOX_FOCUS_NONE && |
| 1298 is_caret_visible() != was_caret_visible) | 1297 is_caret_visible() != was_caret_visible) |
| 1299 view_->ApplyCaretVisibility(); | 1298 view_->ApplyCaretVisibility(); |
| 1300 } | 1299 } |
| OLD | NEW |