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_INSTANT_INSTANT_PAGE_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_PAGE_H_ |
6 #define CHROME_BROWSER_INSTANT_INSTANT_PAGE_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_PAGE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Called when the page wants to navigate to |url|. Usually used by the | 83 // Called when the page wants to navigate to |url|. Usually used by the |
84 // page to navigate to privileged destinations (e.g. chrome:// URLs) or to | 84 // page to navigate to privileged destinations (e.g. chrome:// URLs) or to |
85 // navigate to URLs that are hidden from the page using Restricted IDs (rid | 85 // navigate to URLs that are hidden from the page using Restricted IDs (rid |
86 // in the API). | 86 // in the API). |
87 virtual void NavigateToURL(const content::WebContents* contents, | 87 virtual void NavigateToURL(const content::WebContents* contents, |
88 const GURL& url, | 88 const GURL& url, |
89 content::PageTransition transition, | 89 content::PageTransition transition, |
90 WindowOpenDisposition disposition) = 0; | 90 WindowOpenDisposition disposition) = 0; |
91 | 91 |
92 // Called when the SearchBox wants to delete a Most Visited item. | 92 // Called when the SearchBox wants to delete a Most Visited item. |
93 virtual void DeleteMostVisitedItem(uint64 most_visited_item_id) = 0; | 93 virtual void DeleteMostVisitedItem( |
| 94 InstantRestrictedID most_visited_item_id) = 0; |
94 | 95 |
95 // Called when the SearchBox wants to undo a Most Visited deletion. | 96 // Called when the SearchBox wants to undo a Most Visited deletion. |
96 virtual void UndoMostVisitedDeletion(uint64 most_visited_item_id) = 0; | 97 virtual void UndoMostVisitedDeletion( |
| 98 InstantRestrictedID most_visited_item_id) = 0; |
97 | 99 |
98 // Called when the SearchBox wants to undo all Most Visited deletions. | 100 // Called when the SearchBox wants to undo all Most Visited deletions. |
99 virtual void UndoAllMostVisitedDeletions() = 0; | 101 virtual void UndoAllMostVisitedDeletions() = 0; |
100 | 102 |
101 protected: | 103 protected: |
102 virtual ~Delegate(); | 104 virtual ~Delegate(); |
103 }; | 105 }; |
104 | 106 |
105 virtual ~InstantPage(); | 107 virtual ~InstantPage(); |
106 | 108 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // Tells the page about the current theme background. | 166 // Tells the page about the current theme background. |
165 void SendThemeBackgroundInfo(const ThemeBackgroundInfo& theme_info); | 167 void SendThemeBackgroundInfo(const ThemeBackgroundInfo& theme_info); |
166 | 168 |
167 // Tells the page whether it is allowed to display Instant results. | 169 // Tells the page whether it is allowed to display Instant results. |
168 void SetDisplayInstantResults(bool display_instant_results); | 170 void SetDisplayInstantResults(bool display_instant_results); |
169 | 171 |
170 // Tells the page whether the browser is capturing user key strokes. | 172 // Tells the page whether the browser is capturing user key strokes. |
171 void KeyCaptureChanged(bool is_key_capture_enabled); | 173 void KeyCaptureChanged(bool is_key_capture_enabled); |
172 | 174 |
173 // Tells the page about new Most Visited data. | 175 // Tells the page about new Most Visited data. |
174 void SendMostVisitedItems(const std::vector<InstantMostVisitedItem>& items); | 176 void SendMostVisitedItems( |
| 177 const std::vector<InstantMostVisitedItemIDPair>& items); |
175 | 178 |
176 protected: | 179 protected: |
177 explicit InstantPage(Delegate* delegate); | 180 explicit InstantPage(Delegate* delegate); |
178 | 181 |
179 // Sets |contents| as the page to communicate with. |contents| may be NULL, | 182 // Sets |contents| as the page to communicate with. |contents| may be NULL, |
180 // which effectively stops all communication. | 183 // which effectively stops all communication. |
181 void SetContents(content::WebContents* contents); | 184 void SetContents(content::WebContents* contents); |
182 | 185 |
183 Delegate* delegate() const { return delegate_; } | 186 Delegate* delegate() const { return delegate_; } |
184 | 187 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 InstantShownReason reason, | 224 InstantShownReason reason, |
222 int height, | 225 int height, |
223 InstantSizeUnits units); | 226 InstantSizeUnits units); |
224 void OnFocusOmnibox(int page_id); | 227 void OnFocusOmnibox(int page_id); |
225 void OnStartCapturingKeyStrokes(int page_id); | 228 void OnStartCapturingKeyStrokes(int page_id); |
226 void OnStopCapturingKeyStrokes(int page_id); | 229 void OnStopCapturingKeyStrokes(int page_id); |
227 void OnSearchBoxNavigate(int page_id, | 230 void OnSearchBoxNavigate(int page_id, |
228 const GURL& url, | 231 const GURL& url, |
229 content::PageTransition transition, | 232 content::PageTransition transition, |
230 WindowOpenDisposition disposition); | 233 WindowOpenDisposition disposition); |
231 void OnDeleteMostVisitedItem(uint64 most_visited_item_id); | 234 void OnDeleteMostVisitedItem(InstantRestrictedID most_visited_item_id); |
232 void OnUndoMostVisitedDeletion(uint64 most_visited_item_id); | 235 void OnUndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id); |
233 void OnUndoAllMostVisitedDeletions(); | 236 void OnUndoAllMostVisitedDeletions(); |
234 | 237 |
235 Delegate* const delegate_; | 238 Delegate* const delegate_; |
236 bool supports_instant_; | 239 bool supports_instant_; |
237 | 240 |
238 DISALLOW_COPY_AND_ASSIGN(InstantPage); | 241 DISALLOW_COPY_AND_ASSIGN(InstantPage); |
239 }; | 242 }; |
240 | 243 |
241 #endif // CHROME_BROWSER_INSTANT_INSTANT_PAGE_H_ | 244 #endif // CHROME_BROWSER_INSTANT_INSTANT_PAGE_H_ |
OLD | NEW |