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