Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: chrome/browser/ui/search/instant_controller.h

Issue 14043009: Fall back to local page if online NTP fails to load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 // Invoked by the InstantLoader when the Instant page wants to undo a 275 // Invoked by the InstantLoader when the Instant page wants to undo a
276 // Most Visited deletion. 276 // Most Visited deletion.
277 virtual void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id) 277 virtual void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id)
278 OVERRIDE; 278 OVERRIDE;
279 279
280 // Invoked by the InstantLoader when the Instant page wants to undo all 280 // Invoked by the InstantLoader when the Instant page wants to undo all
281 // Most Visited deletions. 281 // Most Visited deletions.
282 virtual void UndoAllMostVisitedDeletions() OVERRIDE; 282 virtual void UndoAllMostVisitedDeletions() OVERRIDE;
283 283
284 // Invoked by the InstantLoader when the Instant page is preloaded as the
285 // NTP and is ready to display.
286 virtual void InstantPageLoadFailed(content::WebContents* contents) OVERRIDE;
samarth 2013/04/30 17:10:33 Put this with the rest of the InstantPage::Delegat
David Black 2013/04/30 23:09:08 Done.
287
288 // Helper function to navigate the given contents to the local fallback
289 // Instant URL and trim the history correctly.
290 void RedirectToLocalNTP(content::WebContents* contents);
291
284 // Helper for OmniboxFocusChanged. Commit or discard the overlay. 292 // Helper for OmniboxFocusChanged. Commit or discard the overlay.
285 void OmniboxLostFocus(gfx::NativeView view_gaining_focus); 293 void OmniboxLostFocus(gfx::NativeView view_gaining_focus);
286 294
287 // Creates a new NTP, using the instant_url property of the default 295 // Creates a new NTP, using the instant_url property of the default
288 // TemplateURL, or chrome::kChromeSearchLocalNTPURL if |use_local_ntp| is 296 // TemplateURL, or chrome::kChromeSearchLocalNTPURL if |use_local_ntp| is
289 // true. For |ignore_blacklist| look at comments in GetInstantURL(). 297 // true. For |ignore_blacklist| look at comments in GetInstantURL().
290 void ResetNTP(bool ignore_blacklist, bool use_local_ntp); 298 void ResetNTP(bool ignore_blacklist, bool use_local_ntp);
291 299
292 // Ensures that |overlay_| uses the Instant URL returned by GetInstantURL(), 300 // Ensures that |overlay_| uses the Instant URL returned by GetInstantURL(),
293 // creating a new overlay if necessary. In extended mode, will fallback to 301 // creating a new overlay if necessary. In extended mode, will fallback to
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 // Used for Top Sites async retrieval. 482 // Used for Top Sites async retrieval.
475 base::WeakPtrFactory<InstantController> weak_ptr_factory_; 483 base::WeakPtrFactory<InstantController> weak_ptr_factory_;
476 484
477 // Used to get notifications about Most Visted changes. 485 // Used to get notifications about Most Visted changes.
478 content::NotificationRegistrar registrar_; 486 content::NotificationRegistrar registrar_;
479 487
480 DISALLOW_COPY_AND_ASSIGN(InstantController); 488 DISALLOW_COPY_AND_ASSIGN(InstantController);
481 }; 489 };
482 490
483 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ 491 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698