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

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: Rebase. 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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698