Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 21042013: Have SearchProvider look up the omnibox start margin directly. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Respond to comments. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 bool keyword_is_selected = KeywordIsSelected(); 490 bool keyword_is_selected = KeywordIsSelected();
491 omnibox_controller_->StartAutocomplete( 491 omnibox_controller_->StartAutocomplete(
492 user_text_, 492 user_text_,
493 cursor_position, 493 cursor_position,
494 current_url, 494 current_url,
495 ClassifyPage(), 495 ClassifyPage(),
496 prevent_inline_autocomplete || just_deleted_text_ || 496 prevent_inline_autocomplete || just_deleted_text_ ||
497 (has_selected_text && inline_autocomplete_text_.empty()) || 497 (has_selected_text && inline_autocomplete_text_.empty()) ||
498 (paste_state_ != NONE), 498 (paste_state_ != NONE),
499 keyword_is_selected, 499 keyword_is_selected,
500 keyword_is_selected || allow_exact_keyword_match_, 500 keyword_is_selected || allow_exact_keyword_match_);
501 controller_->GetOmniboxBounds().x());
502 } 501 }
503 502
504 void OmniboxEditModel::StopAutocomplete() { 503 void OmniboxEditModel::StopAutocomplete() {
505 autocomplete_controller()->Stop(true); 504 autocomplete_controller()->Stop(true);
506 } 505 }
507 506
508 bool OmniboxEditModel::CanPasteAndGo(const string16& text) const { 507 bool OmniboxEditModel::CanPasteAndGo(const string16& text) const {
509 if (!view_->command_updater()->IsCommandEnabled(IDC_OPEN_CURRENT_URL)) 508 if (!view_->command_updater()->IsCommandEnabled(IDC_OPEN_CURRENT_URL))
510 return false; 509 return false;
511 510
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 instant->OmniboxFocusChanged(state, reason, NULL); 1296 instant->OmniboxFocusChanged(state, reason, NULL);
1298 1297
1299 // Update state and notify view if the omnibox has focus and the caret 1298 // Update state and notify view if the omnibox has focus and the caret
1300 // visibility changed. 1299 // visibility changed.
1301 const bool was_caret_visible = is_caret_visible(); 1300 const bool was_caret_visible = is_caret_visible();
1302 focus_state_ = state; 1301 focus_state_ = state;
1303 if (focus_state_ != OMNIBOX_FOCUS_NONE && 1302 if (focus_state_ != OMNIBOX_FOCUS_NONE &&
1304 is_caret_visible() != was_caret_visible) 1303 is_caret_visible() != was_caret_visible)
1305 view_->ApplyCaretVisibility(); 1304 view_->ApplyCaretVisibility();
1306 } 1305 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698