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_SEARCH_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
14 | 14 |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
18 #include "chrome/browser/ui/search/instant_page.h" | 18 #include "chrome/browser/ui/search/instant_page.h" |
19 #include "chrome/common/search/search_types.h" | 19 #include "chrome/common/search/search_types.h" |
20 | 20 |
21 class BrowserInstantController; | 21 class BrowserInstantController; |
22 class GURL; | 22 class GURL; |
| 23 class InstantPage; |
23 class InstantService; | 24 class InstantService; |
24 class InstantTab; | |
25 class Profile; | 25 class Profile; |
26 struct EmbeddedSearchRequestParams; | 26 struct EmbeddedSearchRequestParams; |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 class WebContents; | 29 class WebContents; |
30 } | 30 } |
31 | 31 |
32 // InstantController drives Chrome Instant, i.e., the browser implementation of | 32 // InstantController drives Chrome Instant, i.e., the browser implementation of |
33 // the Embedded Search API (see http://dev.chromium.org/embeddedsearch). | 33 // the Embedded Search API (see http://dev.chromium.org/embeddedsearch). |
34 // | 34 // |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 const std::list<std::pair<int64_t, std::string>>& debug_events() { | 69 const std::list<std::pair<int64_t, std::string>>& debug_events() { |
70 return debug_events_; | 70 return debug_events_; |
71 } | 71 } |
72 | 72 |
73 // Used by BrowserInstantController to notify InstantController about the | 73 // Used by BrowserInstantController to notify InstantController about the |
74 // instant support change event for the active web contents. | 74 // instant support change event for the active web contents. |
75 void InstantSupportChanged(InstantSupportState instant_support); | 75 void InstantSupportChanged(InstantSupportState instant_support); |
76 | 76 |
77 protected: | 77 protected: |
78 // Accessors are made protected for testing purposes. | 78 // Accessors are made protected for testing purposes. |
79 virtual InstantTab* instant_tab() const; | 79 virtual InstantPage* instant_tab() const; |
80 | 80 |
81 virtual Profile* profile() const; | 81 virtual Profile* profile() const; |
82 | 82 |
83 private: | 83 private: |
84 friend class InstantExtendedManualTest; | 84 friend class InstantExtendedManualTest; |
85 friend class InstantTestBase; | 85 friend class InstantTestBase; |
86 | 86 |
87 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ExtendedModeIsOn); | 87 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ExtendedModeIsOn); |
88 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, MostVisited); | 88 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, MostVisited); |
89 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ProcessIsolation); | 89 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ProcessIsolation); |
(...skipping 28 matching lines...) Expand all Loading... |
118 | 118 |
119 // Sends theme info and most visited items to the Instant tab. | 119 // Sends theme info and most visited items to the Instant tab. |
120 void UpdateInfoForInstantTab(); | 120 void UpdateInfoForInstantTab(); |
121 | 121 |
122 // Returns the InstantService for the browser profile. | 122 // Returns the InstantService for the browser profile. |
123 InstantService* GetInstantService() const; | 123 InstantService* GetInstantService() const; |
124 | 124 |
125 BrowserInstantController* const browser_; | 125 BrowserInstantController* const browser_; |
126 | 126 |
127 // The instance of InstantPage maintained by InstantController. | 127 // The instance of InstantPage maintained by InstantController. |
128 std::unique_ptr<InstantTab> instant_tab_; | 128 std::unique_ptr<InstantPage> instant_tab_; |
129 | 129 |
130 // The search model mode for the active tab. | 130 // The search model mode for the active tab. |
131 SearchMode search_mode_; | 131 SearchMode search_mode_; |
132 | 132 |
133 // List of events and their timestamps, useful in debugging Instant behaviour. | 133 // List of events and their timestamps, useful in debugging Instant behaviour. |
134 mutable std::list<std::pair<int64_t, std::string>> debug_events_; | 134 mutable std::list<std::pair<int64_t, std::string>> debug_events_; |
135 | 135 |
136 DISALLOW_COPY_AND_ASSIGN(InstantController); | 136 DISALLOW_COPY_AND_ASSIGN(InstantController); |
137 }; | 137 }; |
138 | 138 |
139 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ | 139 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
OLD | NEW |