Chromium Code Reviews| 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_INSTANT_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 const content::WebContents* contents) OVERRIDE; | 244 const content::WebContents* contents) OVERRIDE; |
| 245 virtual void StopCapturingKeyStrokes(content::WebContents* contents) OVERRIDE; | 245 virtual void StopCapturingKeyStrokes(content::WebContents* contents) OVERRIDE; |
| 246 virtual void NavigateToURL( | 246 virtual void NavigateToURL( |
| 247 const content::WebContents* contents, | 247 const content::WebContents* contents, |
| 248 const GURL& url, | 248 const GURL& url, |
| 249 content::PageTransition transition, | 249 content::PageTransition transition, |
| 250 WindowOpenDisposition disposition) OVERRIDE; | 250 WindowOpenDisposition disposition) OVERRIDE; |
| 251 | 251 |
| 252 // Invoked by the InstantLoader when the Instant page wants to delete a | 252 // Invoked by the InstantLoader when the Instant page wants to delete a |
| 253 // Most Visited item. | 253 // Most Visited item. |
| 254 virtual void DeleteMostVisitedItem(uint64 most_visited_item_id) OVERRIDE; | 254 virtual void DeleteMostVisitedItem(InstantRestrictedID restricted_id) |
|
dhollowa
2013/03/14 00:02:43
Lets keep |most_visited_item_id| for clarity. The
Shishir
2013/03/14 19:53:03
Done.
| |
| 255 OVERRIDE; | |
| 255 | 256 |
| 256 // Invoked by the InstantLoader when the Instant page wants to undo a | 257 // Invoked by the InstantLoader when the Instant page wants to undo a |
| 257 // Most Visited deletion. | 258 // Most Visited deletion. |
| 258 virtual void UndoMostVisitedDeletion(uint64 most_visited_item_id) OVERRIDE; | 259 virtual void UndoMostVisitedDeletion(InstantRestrictedID restricted_id) |
|
dhollowa
2013/03/14 00:02:43
Ditto.
Shishir
2013/03/14 19:53:03
Done.
| |
| 260 OVERRIDE; | |
| 259 | 261 |
| 260 // Invoked by the InstantLoader when the Instant page wants to undo all | 262 // Invoked by the InstantLoader when the Instant page wants to undo all |
| 261 // Most Visited deletions. | 263 // Most Visited deletions. |
| 262 virtual void UndoAllMostVisitedDeletions() OVERRIDE; | 264 virtual void UndoAllMostVisitedDeletions() OVERRIDE; |
| 263 | 265 |
| 264 // Helper for OmniboxFocusChanged. Commit or discard the overlay. | 266 // Helper for OmniboxFocusChanged. Commit or discard the overlay. |
| 265 void OmniboxLostFocus(gfx::NativeView view_gaining_focus); | 267 void OmniboxLostFocus(gfx::NativeView view_gaining_focus); |
| 266 | 268 |
| 267 // Creates a new NTP, using the instant_url property of the default | 269 // Creates a new NTP, using the instant_url property of the default |
| 268 // TemplateURL. | 270 // TemplateURL. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 // Fire off an async request for most visited items to the TopNav code. | 344 // Fire off an async request for most visited items to the TopNav code. |
| 343 void RequestMostVisitedItems(); | 345 void RequestMostVisitedItems(); |
| 344 | 346 |
| 345 // Called when we get new most visited items from the TopNav code, | 347 // Called when we get new most visited items from the TopNav code, |
| 346 // registered as an async callback. Parses them and sends them to the | 348 // registered as an async callback. Parses them and sends them to the |
| 347 // renderer via SendMostVisitedItems. | 349 // renderer via SendMostVisitedItems. |
| 348 void OnMostVisitedItemsReceived(const history::MostVisitedURLList& data); | 350 void OnMostVisitedItemsReceived(const history::MostVisitedURLList& data); |
| 349 | 351 |
| 350 // Sends a collection of MostVisitedItems to the renderer process via | 352 // Sends a collection of MostVisitedItems to the renderer process via |
| 351 // the appropriate InstantPage subclass. | 353 // the appropriate InstantPage subclass. |
| 352 void SendMostVisitedItems(const std::vector<InstantMostVisitedItem>& items); | 354 void SendMostVisitedItems( |
| 355 const std::vector<InstantMostVisitedItemIDPair>& items); | |
| 353 | 356 |
| 354 chrome::BrowserInstantController* const browser_; | 357 chrome::BrowserInstantController* const browser_; |
| 355 | 358 |
| 356 // Whether the extended API and regular API are enabled. If both are false, | 359 // Whether the extended API and regular API are enabled. If both are false, |
| 357 // Instant is effectively disabled. | 360 // Instant is effectively disabled. |
| 358 const bool extended_enabled_; | 361 const bool extended_enabled_; |
| 359 bool instant_enabled_; | 362 bool instant_enabled_; |
| 360 | 363 |
| 361 // If true, the Instant URL is set to kLocalOmniboxPopupURL. | 364 // If true, the Instant URL is set to kLocalOmniboxPopupURL. |
| 362 bool use_local_overlay_only_; | 365 bool use_local_overlay_only_; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 447 // Used for Top Sites async retrieval. | 450 // Used for Top Sites async retrieval. |
| 448 base::WeakPtrFactory<InstantController> weak_ptr_factory_; | 451 base::WeakPtrFactory<InstantController> weak_ptr_factory_; |
| 449 | 452 |
| 450 // Used to get notifications about Most Visted changes. | 453 // Used to get notifications about Most Visted changes. |
| 451 content::NotificationRegistrar registrar_; | 454 content::NotificationRegistrar registrar_; |
| 452 | 455 |
| 453 DISALLOW_COPY_AND_ASSIGN(InstantController); | 456 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 454 }; | 457 }; |
| 455 | 458 |
| 456 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 459 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| OLD | NEW |