| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 14 #include "chrome/browser/ui/webui/mojo_web_ui_handler.h" | 15 #include "chrome/browser/ui/webui/mojo_web_ui_handler.h" |
| 15 #include "chrome/browser/ui/webui/omnibox/omnibox.mojom.h" | 16 #include "chrome/browser/ui/webui/omnibox/omnibox.mojom.h" |
| 16 #include "components/omnibox/browser/autocomplete_controller_delegate.h" | 17 #include "components/omnibox/browser/autocomplete_controller_delegate.h" |
| 17 #include "components/omnibox/browser/autocomplete_input.h" | 18 #include "components/omnibox/browser/autocomplete_input.h" |
| 18 #include "components/omnibox/browser/autocomplete_match.h" | 19 #include "components/omnibox/browser/autocomplete_match.h" |
| 19 #include "mojo/public/cpp/bindings/binding.h" | 20 #include "mojo/public/cpp/bindings/binding.h" |
| 20 | 21 |
| 21 class AutocompleteController; | 22 class AutocompleteController; |
| 22 class Profile; | 23 class Profile; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 50 // typed visits). Return true if the lookup succeeded; if so, the | 51 // typed visits). Return true if the lookup succeeded; if so, the |
| 51 // value of |is_typed_host| is set appropriately. | 52 // value of |is_typed_host| is set appropriately. |
| 52 bool LookupIsTypedHost(const base::string16& host, bool* is_typed_host) const; | 53 bool LookupIsTypedHost(const base::string16& host, bool* is_typed_host) const; |
| 53 | 54 |
| 54 // Re-initializes the AutocompleteController in preparation for the | 55 // Re-initializes the AutocompleteController in preparation for the |
| 55 // next query. | 56 // next query. |
| 56 void ResetController(); | 57 void ResetController(); |
| 57 | 58 |
| 58 // The omnibox AutocompleteController that collects/sorts/dup- | 59 // The omnibox AutocompleteController that collects/sorts/dup- |
| 59 // eliminates the results as they come in. | 60 // eliminates the results as they come in. |
| 60 scoped_ptr<AutocompleteController> controller_; | 61 std::unique_ptr<AutocompleteController> controller_; |
| 61 | 62 |
| 62 // Time the user's input was sent to the omnibox to start searching. | 63 // Time the user's input was sent to the omnibox to start searching. |
| 63 // Needed because we also pass timing information in the object we | 64 // Needed because we also pass timing information in the object we |
| 64 // hand back to the javascript. | 65 // hand back to the javascript. |
| 65 base::Time time_omnibox_started_; | 66 base::Time time_omnibox_started_; |
| 66 | 67 |
| 67 // The input used when starting the AutocompleteController. | 68 // The input used when starting the AutocompleteController. |
| 68 AutocompleteInput input_; | 69 AutocompleteInput input_; |
| 69 | 70 |
| 70 // Handle back to the page by which we can pass results. | 71 // Handle back to the page by which we can pass results. |
| 71 mojom::OmniboxPagePtr page_; | 72 mojom::OmniboxPagePtr page_; |
| 72 | 73 |
| 73 // The Profile* handed to us in our constructor. | 74 // The Profile* handed to us in our constructor. |
| 74 Profile* profile_; | 75 Profile* profile_; |
| 75 | 76 |
| 76 mojo::Binding<mojom::OmniboxUIHandlerMojo> binding_; | 77 mojo::Binding<mojom::OmniboxUIHandlerMojo> binding_; |
| 77 | 78 |
| 78 DISALLOW_COPY_AND_ASSIGN(OmniboxUIHandler); | 79 DISALLOW_COPY_AND_ASSIGN(OmniboxUIHandler); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 #endif // CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ | 82 #endif // CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ |
| OLD | NEW |