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

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

Issue 12895007: Send onsubmit query down to the instant extended overlay page when a navigation is performed from t… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check return value of UpdateSearchState. Created 7 years, 8 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 | Annotate | Revision Log
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 <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 bool OnUpOrDownKeyPressed(int count); 111 bool OnUpOrDownKeyPressed(int count);
112 112
113 // Called when the user has arrowed into the suggestions but wants to cancel, 113 // Called when the user has arrowed into the suggestions but wants to cancel,
114 // typically by pressing ESC. The omnibox text is expected to have been 114 // typically by pressing ESC. The omnibox text is expected to have been
115 // reverted to |full_text| by the OmniboxEditModel prior to calling this. 115 // reverted to |full_text| by the OmniboxEditModel prior to calling this.
116 // |match| is the match reverted to. 116 // |match| is the match reverted to.
117 void OnCancel(const AutocompleteMatch& match, 117 void OnCancel(const AutocompleteMatch& match,
118 const string16& user_text, 118 const string16& user_text,
119 const string16& full_text); 119 const string16& full_text);
120 120
121 // Called when the user navigates to a URL from the omnibox. This will send
122 // an onsubmit notification to the instant page.
123 void OmniboxNavigateToURL();
124
121 // The overlay WebContents. May be NULL. InstantController retains ownership. 125 // The overlay WebContents. May be NULL. InstantController retains ownership.
122 content::WebContents* GetOverlayContents() const; 126 content::WebContents* GetOverlayContents() const;
123 127
124 // Returns true if Instant is showing a search results overlay. Returns false 128 // Returns true if Instant is showing a search results overlay. Returns false
125 // if the overlay is not showing, or if it's showing only suggestions. 129 // if the overlay is not showing, or if it's showing only suggestions.
126 bool IsOverlayingSearchResults() const; 130 bool IsOverlayingSearchResults() const;
127 131
128 // If the overlay is showing search results, commits the overlay, calling 132 // If the overlay is showing search results, commits the overlay, calling
129 // CommitInstant() on the browser, and returns true. Else, returns false. 133 // CommitInstant() on the browser, and returns true. Else, returns false.
130 bool CommitIfPossible(InstantCommitType type); 134 bool CommitIfPossible(InstantCommitType type);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 FRIEND_TEST_ALL_PREFIXES(InstantTest, InstantOverlayRefresh); 203 FRIEND_TEST_ALL_PREFIXES(InstantTest, InstantOverlayRefresh);
200 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ExtendedModeIsOn); 204 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ExtendedModeIsOn);
201 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, MostVisited); 205 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, MostVisited);
202 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, RestrictedItemReadback); 206 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, RestrictedItemReadback);
203 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, OmniboxFocusLoadsInstant); 207 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, OmniboxFocusLoadsInstant);
204 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, 208 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest,
205 OmniboxTextUponFocusedCommittedSERP); 209 OmniboxTextUponFocusedCommittedSERP);
206 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, 210 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest,
207 NavigationSuggestionIsDiscardedUponSearchSuggestion); 211 NavigationSuggestionIsDiscardedUponSearchSuggestion);
208 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, 212 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest,
213 NavigateToURLSuggestionHitEnterAndLookForSubmit);
214 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest,
209 MiddleClickOnSuggestionOpensInNewTab); 215 MiddleClickOnSuggestionOpensInNewTab);
210 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, NTPIsPreloaded); 216 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, NTPIsPreloaded);
211 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, PreloadedNTPIsUsedInNewTab); 217 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, PreloadedNTPIsUsedInNewTab);
212 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, PreloadedNTPIsUsedInSameTab); 218 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, PreloadedNTPIsUsedInSameTab);
213 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, PreloadedNTPForWrongProvider); 219 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, PreloadedNTPForWrongProvider);
214 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ProcessIsolation); 220 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ProcessIsolation);
215 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, UnrelatedSiteInstance); 221 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, UnrelatedSiteInstance);
216 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ValidatesSuggestions); 222 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ValidatesSuggestions);
217 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, 223 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest,
218 OmniboxCommitsWhenShownFullHeight); 224 OmniboxCommitsWhenShownFullHeight);
219 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, LocalNTPIsNotLocalOverlay); 225 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, LocalNTPIsNotLocalOverlay);
220 FRIEND_TEST_ALL_PREFIXES(InstantExtendedManualTest, 226 FRIEND_TEST_ALL_PREFIXES(InstantExtendedManualTest,
221 MANUAL_OmniboxFocusLoadsInstant); 227 MANUAL_OmniboxFocusLoadsInstant);
222 228
223 // Overridden from content::NotificationObserver: 229 // Overridden from content::NotificationObserver:
224 virtual void Observe(int type, 230 virtual void Observe(int type,
225 const content::NotificationSource& source, 231 const content::NotificationSource& source,
226 const content::NotificationDetails& details) OVERRIDE; 232 const content::NotificationDetails& details) OVERRIDE;
227 233
228 // Overridden from InstantPage::Delegate: 234 // Overridden from InstantPage::Delegate:
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 // Used for Top Sites async retrieval. 470 // Used for Top Sites async retrieval.
465 base::WeakPtrFactory<InstantController> weak_ptr_factory_; 471 base::WeakPtrFactory<InstantController> weak_ptr_factory_;
466 472
467 // Used to get notifications about Most Visted changes. 473 // Used to get notifications about Most Visted changes.
468 content::NotificationRegistrar registrar_; 474 content::NotificationRegistrar registrar_;
469 475
470 DISALLOW_COPY_AND_ASSIGN(InstantController); 476 DISALLOW_COPY_AND_ASSIGN(InstantController);
471 }; 477 };
472 478
473 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ 479 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_edit_model.cc ('k') | chrome/browser/ui/search/instant_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698