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_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_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 24 matching lines...) Expand all Loading... |
35 // ErrorHandler overrides: | 35 // ErrorHandler overrides: |
36 void OnConnectionError() override { | 36 void OnConnectionError() override { |
37 // TODO(darin): How should we handle connection error? | 37 // TODO(darin): How should we handle connection error? |
38 } | 38 } |
39 | 39 |
40 // OmniboxUIHandlerMojo overrides: | 40 // OmniboxUIHandlerMojo overrides: |
41 void StartOmniboxQuery(const mojo::String& input_string, | 41 void StartOmniboxQuery(const mojo::String& input_string, |
42 int32_t cursor_position, | 42 int32_t cursor_position, |
43 bool prevent_inline_autocomplete, | 43 bool prevent_inline_autocomplete, |
44 bool prefer_keyword, | 44 bool prefer_keyword, |
45 int32_t page_classification) override; | 45 int32_t page_classification, |
| 46 OmniboxPagePtr page) override; |
46 | 47 |
47 private: | 48 private: |
48 // Looks up whether the hostname is a typed host (i.e., has received | 49 // Looks up whether the hostname is a typed host (i.e., has received |
49 // typed visits). Return true if the lookup succeeded; if so, the | 50 // typed visits). Return true if the lookup succeeded; if so, the |
50 // value of |is_typed_host| is set appropriately. | 51 // value of |is_typed_host| is set appropriately. |
51 bool LookupIsTypedHost(const base::string16& host, bool* is_typed_host) const; | 52 bool LookupIsTypedHost(const base::string16& host, bool* is_typed_host) const; |
52 | 53 |
53 // Re-initializes the AutocompleteController in preparation for the | 54 // Re-initializes the AutocompleteController in preparation for the |
54 // next query. | 55 // next query. |
55 void ResetController(); | 56 void ResetController(); |
56 | 57 |
57 // The omnibox AutocompleteController that collects/sorts/dup- | 58 // The omnibox AutocompleteController that collects/sorts/dup- |
58 // eliminates the results as they come in. | 59 // eliminates the results as they come in. |
59 scoped_ptr<AutocompleteController> controller_; | 60 scoped_ptr<AutocompleteController> controller_; |
60 | 61 |
61 // Time the user's input was sent to the omnibox to start searching. | 62 // Time the user's input was sent to the omnibox to start searching. |
62 // Needed because we also pass timing information in the object we | 63 // Needed because we also pass timing information in the object we |
63 // hand back to the javascript. | 64 // hand back to the javascript. |
64 base::Time time_omnibox_started_; | 65 base::Time time_omnibox_started_; |
65 | 66 |
66 // The input used when starting the AutocompleteController. | 67 // The input used when starting the AutocompleteController. |
67 AutocompleteInput input_; | 68 AutocompleteInput input_; |
68 | 69 |
| 70 // Handle back to the page by which we can pass results. |
| 71 OmniboxPagePtr page_; |
| 72 |
69 // The Profile* handed to us in our constructor. | 73 // The Profile* handed to us in our constructor. |
70 Profile* profile_; | 74 Profile* profile_; |
71 | 75 |
72 DISALLOW_COPY_AND_ASSIGN(OmniboxUIHandler); | 76 DISALLOW_COPY_AND_ASSIGN(OmniboxUIHandler); |
73 }; | 77 }; |
74 | 78 |
75 #endif // CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ | 79 #endif // CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ |
OLD | NEW |