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

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

Issue 13141002: Use Instant suggested match type for Instant temporary text. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TODO Created 7 years, 8 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 | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_
6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 // which is the URL of the current page. 491 // which is the URL of the current page.
492 // 492 //
493 // original_url_ is only valid when there is temporary text, and is used as 493 // original_url_ is only valid when there is temporary text, and is used as
494 // the unique identifier of the originally selected item. Thus, if the user 494 // the unique identifier of the originally selected item. Thus, if the user
495 // arrows to a different item with the same text, we can still distinguish 495 // arrows to a different item with the same text, we can still distinguish
496 // them and not revert all the way to the permanent_text_. 496 // them and not revert all the way to the permanent_text_.
497 bool has_temporary_text_; 497 bool has_temporary_text_;
498 GURL original_url_; 498 GURL original_url_;
499 499
500 // True if Instant set the current temporary text, as opposed to it being set 500 // True if Instant set the current temporary text, as opposed to it being set
501 // due to the user arrowing up/down through the popup. 501 // due to the user arrowing up/down through the popup. This can only be true
502 // if |has_temporary_text_| is true.
502 // TODO(sreeram): This is a temporary hack. Remove it once the omnibox edit 503 // TODO(sreeram): This is a temporary hack. Remove it once the omnibox edit
503 // model/view code is decoupled from Instant (among other things). 504 // model/view code is decoupled from Instant (among other things).
504 bool is_temporary_text_set_by_instant_; 505 bool is_temporary_text_set_by_instant_;
505 506
507 // True if the current temporary text set by Instant is a search query; false
508 // if it is a URL that can be directly navigated to. This is only valid if
509 // |is_temporary_text_set_by_instant_| is true. This field is needed because
510 // Instant's temporary text doesn't come from the popup model, so we can't
511 // lookup its type from the current match.
512 bool is_instant_temporary_text_a_search_query_;
513
506 // When the user's last action was to paste, we disallow inline autocomplete 514 // When the user's last action was to paste, we disallow inline autocomplete
507 // (on the theory that the user is trying to paste in a new URL or part of 515 // (on the theory that the user is trying to paste in a new URL or part of
508 // one, and in either case inline autocomplete would get in the way). 516 // one, and in either case inline autocomplete would get in the way).
509 PasteState paste_state_; 517 PasteState paste_state_;
510 518
511 // Whether the control key is depressed. We track this to avoid calling 519 // Whether the control key is depressed. We track this to avoid calling
512 // UpdatePopup() repeatedly if the user holds down the key, and to know 520 // UpdatePopup() repeatedly if the user holds down the key, and to know
513 // whether to trigger "ctrl-enter" behavior. 521 // whether to trigger "ctrl-enter" behavior.
514 ControlKeyState control_key_state_; 522 ControlKeyState control_key_state_;
515 523
(...skipping 24 matching lines...) Expand all
540 // an exact keyword match. If this is true then keyword mode will be 548 // an exact keyword match. If this is true then keyword mode will be
541 // triggered automatically if the input is "<keyword> <search string>". We 549 // triggered automatically if the input is "<keyword> <search string>". We
542 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. 550 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true.
543 // This has no effect if we're already in keyword mode. 551 // This has no effect if we're already in keyword mode.
544 bool allow_exact_keyword_match_; 552 bool allow_exact_keyword_match_;
545 553
546 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); 554 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel);
547 }; 555 };
548 556
549 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ 557 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698