Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/ui/search/instant_controller.h

Issue 2269933002: Instant cleanup: remove MODE_SEARCH_RESULTS and ORIGIN_SEARCH (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_url_replacement
Patch Set: review Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_tab.h" 18 #include "chrome/browser/ui/search/instant_tab.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 InstantService; 23 class InstantService;
24 class Profile; 24 class Profile;
25 struct EmbeddedSearchRequestParams;
26 25
27 namespace content { 26 namespace content {
28 class WebContents; 27 class WebContents;
29 } 28 }
30 29
31 // InstantController drives Chrome Instant, i.e., the browser implementation of 30 // InstantController drives Chrome Instant, i.e., the browser implementation of
32 // the Embedded Search API (see http://dev.chromium.org/embeddedsearch). 31 // the Embedded Search API (see http://dev.chromium.org/embeddedsearch).
33 // 32 //
34 // In extended mode, InstantController maintains and coordinates an InstantTab. 33 // In extended mode, InstantController maintains and coordinates an InstantTab.
35 // An InstantTab instance points to the currently active tab, if it supports the 34 // An InstantTab instance points to the currently active tab, if it supports the
36 // Embedded Search API. InstantTab is backed by a WebContents and it does not 35 // Embedded Search API. InstantTab is backed by a WebContents and it does not
37 // own that WebContents. 36 // own that WebContents.
38 // 37 //
39 // InstantController is owned by Browser via BrowserInstantController. 38 // InstantController is owned by Browser via BrowserInstantController.
40 class InstantController : public InstantTab::Delegate { 39 class InstantController : public InstantTab::Delegate {
41 public: 40 public:
42 explicit InstantController(BrowserInstantController* browser); 41 explicit InstantController(BrowserInstantController* browser);
43 ~InstantController() override; 42 ~InstantController() override;
44 43
45 // Called if the browser is navigating to a search URL for |search_terms| with
46 // search-term-replacement enabled. If |instant_tab_| can be used to process
47 // the search, this does so and returns true. Else, returns false.
48 bool SubmitQuery(const base::string16& search_terms,
49 const EmbeddedSearchRequestParams& params);
50
51 // The search mode in the active tab has changed. Bind |instant_tab_| if the 44 // The search mode in the active tab has changed. Bind |instant_tab_| if the
52 // |new_mode| reflects an Instant search results page. 45 // |new_mode| reflects an Instant search results page.
53 void SearchModeChanged(const SearchMode& old_mode, 46 void SearchModeChanged(const SearchMode& old_mode,
54 const SearchMode& new_mode); 47 const SearchMode& new_mode);
55 48
56 // The user switched tabs. Bind |instant_tab_| if the newly active tab is an 49 // The user switched tabs. Bind |instant_tab_| if the newly active tab is an
57 // Instant search results page. 50 // Instant search results page.
58 void ActiveTabChanged(); 51 void ActiveTabChanged();
59 52
60 // Used by BrowserInstantController to notify InstantController about the 53 // Used by BrowserInstantController to notify InstantController about the
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // The search model mode for the active tab. 116 // The search model mode for the active tab.
124 SearchMode search_mode_; 117 SearchMode search_mode_;
125 118
126 // List of events and their timestamps, useful in debugging Instant behaviour. 119 // List of events and their timestamps, useful in debugging Instant behaviour.
127 mutable std::list<std::pair<int64_t, std::string>> debug_events_; 120 mutable std::list<std::pair<int64_t, std::string>> debug_events_;
128 121
129 DISALLOW_COPY_AND_ASSIGN(InstantController); 122 DISALLOW_COPY_AND_ASSIGN(InstantController);
130 }; 123 };
131 124
132 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ 125 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_instant_controller.cc ('k') | chrome/browser/ui/search/instant_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698