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 #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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // created a |new_text| that looks like "<keyword> <search phrase>". | 385 // created a |new_text| that looks like "<keyword> <search phrase>". |
386 bool CreatedKeywordSearchByInsertingSpaceInMiddle( | 386 bool CreatedKeywordSearchByInsertingSpaceInMiddle( |
387 const string16& old_text, | 387 const string16& old_text, |
388 const string16& new_text, | 388 const string16& new_text, |
389 size_t caret_position) const; | 389 size_t caret_position) const; |
390 | 390 |
391 // Checks if a given character is a valid space character for accepting | 391 // Checks if a given character is a valid space character for accepting |
392 // keyword. | 392 // keyword. |
393 static bool IsSpaceCharForAcceptingKeyword(wchar_t c); | 393 static bool IsSpaceCharForAcceptingKeyword(wchar_t c); |
394 | 394 |
395 // Classify the current page being viewed as, for example, the new tab | 395 // Returns the user's context for the current input: for example, the fakebox |
396 // page or a normal web page. Used for logging omnibox events for | 396 // on the InstantExtended new tab page or a normal web page. Used for logging |
397 // UMA opted-in users. Examines the user's profile to determine if the | 397 // omnibox events for UMA opted-in users. Examines the user's profile to |
398 // current page is the user's home page. | 398 // determine if the current page is the user's home page. |
399 AutocompleteInput::PageClassification ClassifyPage() const; | 399 AutocompleteInput::OmniboxContext GetOmniboxContext() const; |
400 | 400 |
401 // Sets |match| and |alternate_nav_url| based on classifying |text|. | 401 // Sets |match| and |alternate_nav_url| based on classifying |text|. |
402 // |alternate_nav_url| may be NULL. | 402 // |alternate_nav_url| may be NULL. |
403 void ClassifyStringForPasteAndGo(const string16& text, | 403 void ClassifyStringForPasteAndGo(const string16& text, |
404 AutocompleteMatch* match, | 404 AutocompleteMatch* match, |
405 GURL* alternate_nav_url) const; | 405 GURL* alternate_nav_url) const; |
406 | 406 |
407 // If focus_state_ does not match |state|, we update it and notify the | 407 // If focus_state_ does not match |state|, we update it and notify the |
408 // InstantController about the change (passing along the |reason| for the | 408 // InstantController about the change (passing along the |reason| for the |
409 // change). If the caret visibility changes, we call ApplyCaretVisibility() on | 409 // change). If the caret visibility changes, we call ApplyCaretVisibility() on |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 // an exact keyword match. If this is true then keyword mode will be | 527 // an exact keyword match. If this is true then keyword mode will be |
528 // triggered automatically if the input is "<keyword> <search string>". We | 528 // triggered automatically if the input is "<keyword> <search string>". We |
529 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. | 529 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. |
530 // This has no effect if we're already in keyword mode. | 530 // This has no effect if we're already in keyword mode. |
531 bool allow_exact_keyword_match_; | 531 bool allow_exact_keyword_match_; |
532 | 532 |
533 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); | 533 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); |
534 }; | 534 }; |
535 | 535 |
536 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 536 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
OLD | NEW |