Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PAGE_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_PAGE_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_PAGE_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_PAGE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "chrome/common/instant_types.h" | 13 #include "chrome/common/instant_types.h" |
| 14 #include "chrome/common/omnibox_focus_state.h" | |
| 14 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "content/public/common/page_transition_types.h" | 16 #include "content/public/common/page_transition_types.h" |
| 16 | 17 |
| 17 class GURL; | 18 class GURL; |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 class WebContents; | 21 class WebContents; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace gfx { | 24 namespace gfx { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 virtual void SetSuggestions( | 59 virtual void SetSuggestions( |
| 59 const content::WebContents* contents, | 60 const content::WebContents* contents, |
| 60 const std::vector<InstantSuggestion>& suggestions) = 0; | 61 const std::vector<InstantSuggestion>& suggestions) = 0; |
| 61 | 62 |
| 62 // Called when the page wants to be shown. Usually in response to Update() | 63 // Called when the page wants to be shown. Usually in response to Update() |
| 63 // or SendAutocompleteResults(). | 64 // or SendAutocompleteResults(). |
| 64 virtual void ShowInstantOverlay(const content::WebContents* contents, | 65 virtual void ShowInstantOverlay(const content::WebContents* contents, |
| 65 int height, | 66 int height, |
| 66 InstantSizeUnits units) = 0; | 67 InstantSizeUnits units) = 0; |
| 67 | 68 |
| 68 // Called when the page wants the omnibox to be focused. | 69 // Called when the page wants the omnibox to be focused. |state| specifies |
| 69 virtual void FocusOmnibox(const content::WebContents* contents) = 0; | 70 // whether the omnibox focus state. |
|
sreeram
2013/04/01 16:04:38
Delete "whether".
kmadhusu
2013/04/02 02:06:50
Done.
| |
| 70 | 71 virtual void FocusOmnibox(const content::WebContents* contents, |
| 71 // Called when the page wants the omnibox to start capturing user key | 72 OmniboxFocusState state) = 0; |
| 72 // strokes. If this call is processed successfully, the omnibox will not | |
| 73 // look focused visibly but any user key strokes will go to the omnibox. | |
| 74 // Currently, this is implemented by focusing the omnibox invisibly. | |
| 75 virtual void StartCapturingKeyStrokes( | |
| 76 const content::WebContents* contents) = 0; | |
| 77 | |
| 78 // Called when the page wants the omnibox to stop capturing user key | |
| 79 // strokes. | |
| 80 virtual void StopCapturingKeyStrokes(content::WebContents* contents) = 0; | |
| 81 | 73 |
| 82 // Called when the page wants to navigate to |url|. Usually used by the | 74 // Called when the page wants to navigate to |url|. Usually used by the |
| 83 // page to navigate to privileged destinations (e.g. chrome:// URLs) or to | 75 // page to navigate to privileged destinations (e.g. chrome:// URLs) or to |
| 84 // navigate to URLs that are hidden from the page using Restricted IDs (rid | 76 // navigate to URLs that are hidden from the page using Restricted IDs (rid |
| 85 // in the API). | 77 // in the API). |
| 86 virtual void NavigateToURL(const content::WebContents* contents, | 78 virtual void NavigateToURL(const content::WebContents* contents, |
| 87 const GURL& url, | 79 const GURL& url, |
| 88 content::PageTransition transition, | 80 content::PageTransition transition, |
| 89 WindowOpenDisposition disposition) = 0; | 81 WindowOpenDisposition disposition) = 0; |
| 90 | 82 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 const GURL& url, | 204 const GURL& url, |
| 213 content::PageTransition transition_type, | 205 content::PageTransition transition_type, |
| 214 content::RenderViewHost* render_view_host) OVERRIDE; | 206 content::RenderViewHost* render_view_host) OVERRIDE; |
| 215 | 207 |
| 216 void OnSetSuggestions(int page_id, | 208 void OnSetSuggestions(int page_id, |
| 217 const std::vector<InstantSuggestion>& suggestions); | 209 const std::vector<InstantSuggestion>& suggestions); |
| 218 void OnInstantSupportDetermined(int page_id, bool supports_instant); | 210 void OnInstantSupportDetermined(int page_id, bool supports_instant); |
| 219 void OnShowInstantOverlay(int page_id, | 211 void OnShowInstantOverlay(int page_id, |
| 220 int height, | 212 int height, |
| 221 InstantSizeUnits units); | 213 InstantSizeUnits units); |
| 222 void OnFocusOmnibox(int page_id); | 214 void OnFocusOmnibox(int page_id, OmniboxFocusState state); |
| 223 void OnStartCapturingKeyStrokes(int page_id); | |
| 224 void OnStopCapturingKeyStrokes(int page_id); | |
| 225 void OnSearchBoxNavigate(int page_id, | 215 void OnSearchBoxNavigate(int page_id, |
| 226 const GURL& url, | 216 const GURL& url, |
| 227 content::PageTransition transition, | 217 content::PageTransition transition, |
| 228 WindowOpenDisposition disposition); | 218 WindowOpenDisposition disposition); |
| 229 void OnDeleteMostVisitedItem(InstantRestrictedID most_visited_item_id); | 219 void OnDeleteMostVisitedItem(InstantRestrictedID most_visited_item_id); |
| 230 void OnUndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id); | 220 void OnUndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id); |
| 231 void OnUndoAllMostVisitedDeletions(); | 221 void OnUndoAllMostVisitedDeletions(); |
| 232 | 222 |
| 233 Delegate* const delegate_; | 223 Delegate* const delegate_; |
| 234 bool supports_instant_; | 224 bool supports_instant_; |
| 235 | 225 |
| 236 DISALLOW_COPY_AND_ASSIGN(InstantPage); | 226 DISALLOW_COPY_AND_ASSIGN(InstantPage); |
| 237 }; | 227 }; |
| 238 | 228 |
| 239 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_PAGE_H_ | 229 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_PAGE_H_ |
| OLD | NEW |