OLD | NEW |
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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 const content::WebContents* contents) OVERRIDE; | 249 const content::WebContents* contents) OVERRIDE; |
250 virtual void StopCapturingKeyStrokes(content::WebContents* contents) OVERRIDE; | 250 virtual void StopCapturingKeyStrokes(content::WebContents* contents) OVERRIDE; |
251 virtual void NavigateToURL( | 251 virtual void NavigateToURL( |
252 const content::WebContents* contents, | 252 const content::WebContents* contents, |
253 const GURL& url, | 253 const GURL& url, |
254 content::PageTransition transition, | 254 content::PageTransition transition, |
255 WindowOpenDisposition disposition) OVERRIDE; | 255 WindowOpenDisposition disposition) OVERRIDE; |
256 | 256 |
257 // Invoked by the InstantLoader when the Instant page wants to delete a | 257 // Invoked by the InstantLoader when the Instant page wants to delete a |
258 // Most Visited item. | 258 // Most Visited item. |
259 virtual void DeleteMostVisitedItem(uint64 most_visited_item_id) OVERRIDE; | 259 virtual void DeleteMostVisitedItem(InstantRestrictedID most_visited_item_id) |
| 260 OVERRIDE; |
260 | 261 |
261 // Invoked by the InstantLoader when the Instant page wants to undo a | 262 // Invoked by the InstantLoader when the Instant page wants to undo a |
262 // Most Visited deletion. | 263 // Most Visited deletion. |
263 virtual void UndoMostVisitedDeletion(uint64 most_visited_item_id) OVERRIDE; | 264 virtual void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id) |
| 265 OVERRIDE; |
264 | 266 |
265 // Invoked by the InstantLoader when the Instant page wants to undo all | 267 // Invoked by the InstantLoader when the Instant page wants to undo all |
266 // Most Visited deletions. | 268 // Most Visited deletions. |
267 virtual void UndoAllMostVisitedDeletions() OVERRIDE; | 269 virtual void UndoAllMostVisitedDeletions() OVERRIDE; |
268 | 270 |
269 // Helper for OmniboxFocusChanged. Commit or discard the overlay. | 271 // Helper for OmniboxFocusChanged. Commit or discard the overlay. |
270 void OmniboxLostFocus(gfx::NativeView view_gaining_focus); | 272 void OmniboxLostFocus(gfx::NativeView view_gaining_focus); |
271 | 273 |
272 // Creates a new NTP, using the instant_url property of the default | 274 // Creates a new NTP, using the instant_url property of the default |
273 // TemplateURL. | 275 // TemplateURL. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 // Fire off an async request for most visited items to the TopNav code. | 347 // Fire off an async request for most visited items to the TopNav code. |
346 void RequestMostVisitedItems(); | 348 void RequestMostVisitedItems(); |
347 | 349 |
348 // Called when we get new most visited items from the TopNav code, | 350 // Called when we get new most visited items from the TopNav code, |
349 // registered as an async callback. Parses them and sends them to the | 351 // registered as an async callback. Parses them and sends them to the |
350 // renderer via SendMostVisitedItems. | 352 // renderer via SendMostVisitedItems. |
351 void OnMostVisitedItemsReceived(const history::MostVisitedURLList& data); | 353 void OnMostVisitedItemsReceived(const history::MostVisitedURLList& data); |
352 | 354 |
353 // Sends a collection of MostVisitedItems to the renderer process via | 355 // Sends a collection of MostVisitedItems to the renderer process via |
354 // the appropriate InstantPage subclass. | 356 // the appropriate InstantPage subclass. |
355 void SendMostVisitedItems(const std::vector<InstantMostVisitedItem>& items); | 357 void SendMostVisitedItems( |
| 358 const std::vector<InstantMostVisitedItemIDPair>& items); |
356 | 359 |
357 // If possible, tries to mutate |suggestion| to a valid suggestion. Returns | 360 // If possible, tries to mutate |suggestion| to a valid suggestion. Returns |
358 // true if successful. (Note that |suggestion| may be modified even if this | 361 // true if successful. (Note that |suggestion| may be modified even if this |
359 // returns false.) | 362 // returns false.) |
360 bool FixSuggestion(InstantSuggestion* suggestion) const; | 363 bool FixSuggestion(InstantSuggestion* suggestion) const; |
361 | 364 |
362 chrome::BrowserInstantController* const browser_; | 365 chrome::BrowserInstantController* const browser_; |
363 | 366 |
364 // Whether the extended API and regular API are enabled. If both are false, | 367 // Whether the extended API and regular API are enabled. If both are false, |
365 // Instant is effectively disabled. | 368 // Instant is effectively disabled. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 // Used for Top Sites async retrieval. | 462 // Used for Top Sites async retrieval. |
460 base::WeakPtrFactory<InstantController> weak_ptr_factory_; | 463 base::WeakPtrFactory<InstantController> weak_ptr_factory_; |
461 | 464 |
462 // Used to get notifications about Most Visted changes. | 465 // Used to get notifications about Most Visted changes. |
463 content::NotificationRegistrar registrar_; | 466 content::NotificationRegistrar registrar_; |
464 | 467 |
465 DISALLOW_COPY_AND_ASSIGN(InstantController); | 468 DISALLOW_COPY_AND_ASSIGN(InstantController); |
466 }; | 469 }; |
467 | 470 |
468 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ | 471 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
OLD | NEW |