OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 class InstantController; | 26 class InstantController; |
27 class OmniboxView; | 27 class OmniboxView; |
28 class Profile; | 28 class Profile; |
29 class SkBitmap; | 29 class SkBitmap; |
30 class TabContents; | 30 class TabContents; |
31 | 31 |
32 namespace gfx { | 32 namespace gfx { |
33 class Rect; | 33 class Rect; |
34 } | 34 } |
35 | 35 |
36 namespace predictors { | |
37 class AutocompleteActionPredictor; | |
38 } | |
39 | |
36 // TODO(pkasting): The names and contents of the classes in | 40 // TODO(pkasting): The names and contents of the classes in |
37 // this file are temporary. I am in hack-and-slash mode right now. | 41 // this file are temporary. I am in hack-and-slash mode right now. |
38 // http://code.google.com/p/chromium/issues/detail?id=6772 | 42 // http://code.google.com/p/chromium/issues/detail?id=6772 |
39 | 43 |
40 // Embedders of an AutocompleteEdit widget must implement this class. | 44 // Embedders of an AutocompleteEdit widget must implement this class. |
41 class AutocompleteEditController { | 45 class AutocompleteEditController { |
42 public: | 46 public: |
43 // When the user presses enter or selects a line with the mouse, this | 47 // When the user presses enter or selects a line with the mouse, this |
44 // function will get called synchronously with the url to open and | 48 // function will get called synchronously with the url to open and |
45 // disposition and transition to use when opening it. | 49 // disposition and transition to use when opening it. |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
429 bool CreatedKeywordSearchByInsertingSpaceInMiddle( | 433 bool CreatedKeywordSearchByInsertingSpaceInMiddle( |
430 const string16& old_text, | 434 const string16& old_text, |
431 const string16& new_text, | 435 const string16& new_text, |
432 size_t caret_position) const; | 436 size_t caret_position) const; |
433 | 437 |
434 // Tries to start an instant preview for |match|. Returns true if instant | 438 // Tries to start an instant preview for |match|. Returns true if instant |
435 // processed the match. | 439 // processed the match. |
436 bool DoInstant(const AutocompleteMatch& match, string16* suggested_text); | 440 bool DoInstant(const AutocompleteMatch& match, string16* suggested_text); |
437 | 441 |
438 // Starts a prerender for the given |match|. | 442 // Starts a prerender for the given |match|. |
439 void DoPrerender(const AutocompleteMatch& match); | 443 void DoPrerender(predictors::AutocompleteActionPredictor* action_predictor, |
dominich
2012/06/18 15:32:44
i'd prefer this wasn't passed down. I know it save
gavinp
2012/06/18 16:40:48
Done.
| |
444 const AutocompleteMatch& match); | |
440 | 445 |
441 // Starts a DNS prefetch for the given |match|. | 446 // Starts a DNS prefetch for the given |match|. |
442 void DoPreconnect(const AutocompleteMatch& match); | 447 void DoPreconnect(const AutocompleteMatch& match); |
443 | 448 |
444 // Checks if a given character is a valid space character for accepting | 449 // Checks if a given character is a valid space character for accepting |
445 // keyword. | 450 // keyword. |
446 static bool IsSpaceCharForAcceptingKeyword(wchar_t c); | 451 static bool IsSpaceCharForAcceptingKeyword(wchar_t c); |
447 | 452 |
448 // Classify the current page being viewed as, for example, the new tab | 453 // Classify the current page being viewed as, for example, the new tab |
449 // page or a normal web page. Used for logging omnibox events for | 454 // page or a normal web page. Used for logging omnibox events for |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
564 // This has no effect if we're already in keyword mode. | 569 // This has no effect if we're already in keyword mode. |
565 bool allow_exact_keyword_match_; | 570 bool allow_exact_keyword_match_; |
566 | 571 |
567 // Last value of InstantCompleteBehavior supplied to |SetSuggestedText|. | 572 // Last value of InstantCompleteBehavior supplied to |SetSuggestedText|. |
568 InstantCompleteBehavior instant_complete_behavior_; | 573 InstantCompleteBehavior instant_complete_behavior_; |
569 | 574 |
570 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); | 575 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); |
571 }; | 576 }; |
572 | 577 |
573 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 578 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
OLD | NEW |