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

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: const string16& 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 // which is the URL of the current page. 502 // which is the URL of the current page.
503 // 503 //
504 // original_url_ is only valid when there is temporary text, and is used as 504 // original_url_ is only valid when there is temporary text, and is used as
505 // the unique identifier of the originally selected item. Thus, if the user 505 // the unique identifier of the originally selected item. Thus, if the user
506 // arrows to a different item with the same text, we can still distinguish 506 // arrows to a different item with the same text, we can still distinguish
507 // them and not revert all the way to the permanent_text_. 507 // them and not revert all the way to the permanent_text_.
508 bool has_temporary_text_; 508 bool has_temporary_text_;
509 GURL original_url_; 509 GURL original_url_;
510 510
511 // True if Instant set the current temporary text, as opposed to it being set 511 // True if Instant set the current temporary text, as opposed to it being set
512 // due to the user arrowing up/down through the popup. 512 // due to the user arrowing up/down through the popup. This can only be true
513 // if |has_temporary_text_| is true.
513 // TODO(sreeram): This is a temporary hack. Remove it once the omnibox edit 514 // TODO(sreeram): This is a temporary hack. Remove it once the omnibox edit
514 // model/view code is decoupled from Instant (among other things). 515 // model/view code is decoupled from Instant (among other things).
515 bool is_temporary_text_set_by_instant_; 516 bool is_temporary_text_set_by_instant_;
516 517
518 // True if the current temporary text set by Instant is a search query; false
519 // if it is a URL that can be directly navigated to. This is only valid if
520 // |is_temporary_text_set_by_instant_| is true. This field is needed because
521 // Instant's temporary text doesn't come from the popup model, so we can't
522 // lookup its type from the current match.
523 bool is_instant_temporary_text_a_search_query_;
524
517 // When the user's last action was to paste, we disallow inline autocomplete 525 // When the user's last action was to paste, we disallow inline autocomplete
518 // (on the theory that the user is trying to paste in a new URL or part of 526 // (on the theory that the user is trying to paste in a new URL or part of
519 // one, and in either case inline autocomplete would get in the way). 527 // one, and in either case inline autocomplete would get in the way).
520 PasteState paste_state_; 528 PasteState paste_state_;
521 529
522 // Whether the control key is depressed. We track this to avoid calling 530 // Whether the control key is depressed. We track this to avoid calling
523 // UpdatePopup() repeatedly if the user holds down the key, and to know 531 // UpdatePopup() repeatedly if the user holds down the key, and to know
524 // whether to trigger "ctrl-enter" behavior. 532 // whether to trigger "ctrl-enter" behavior.
525 ControlKeyState control_key_state_; 533 ControlKeyState control_key_state_;
526 534
(...skipping 24 matching lines...) Expand all
551 // an exact keyword match. If this is true then keyword mode will be 559 // an exact keyword match. If this is true then keyword mode will be
552 // triggered automatically if the input is "<keyword> <search string>". We 560 // triggered automatically if the input is "<keyword> <search string>". We
553 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. 561 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true.
554 // This has no effect if we're already in keyword mode. 562 // This has no effect if we're already in keyword mode.
555 bool allow_exact_keyword_match_; 563 bool allow_exact_keyword_match_;
556 564
557 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); 565 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel);
558 }; 566 };
559 567
560 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ 568 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698