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