| 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 #include "chrome/browser/ui/search/instant_ntp_prerenderer.h" | 5 #include "chrome/browser/ui/search/instant_ntp_prerenderer.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 ResetNTP(GetLocalInstantURL()); | 190 ResetNTP(GetLocalInstantURL()); |
| 191 } | 191 } |
| 192 | 192 |
| 193 content::NotificationService::current()->Notify( | 193 content::NotificationService::current()->Notify( |
| 194 chrome::NOTIFICATION_INSTANT_NTP_SUPPORT_DETERMINED, | 194 chrome::NOTIFICATION_INSTANT_NTP_SUPPORT_DETERMINED, |
| 195 content::Source<InstantNTPPrerenderer>(this), | 195 content::Source<InstantNTPPrerenderer>(this), |
| 196 content::NotificationService::NoDetails()); | 196 content::NotificationService::NoDetails()); |
| 197 } | 197 } |
| 198 | 198 |
| 199 void InstantNTPPrerenderer::InstantPageAboutToNavigateMainFrame( | 199 void InstantNTPPrerenderer::InstantPageAboutToNavigateMainFrame( |
| 200 const content::WebContents* contents, | 200 const content::WebContents* /* contents */, |
| 201 const GURL& url) { | 201 const GURL& /* url */) { |
| 202 NOTREACHED(); | 202 NOTREACHED(); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void InstantNTPPrerenderer::FocusOmnibox(const content::WebContents* contents, | 205 void InstantNTPPrerenderer::FocusOmnibox( |
| 206 OmniboxFocusState state) { | 206 const content::WebContents* /* contents */, |
| 207 OmniboxFocusState /* state */) { |
| 207 NOTREACHED(); | 208 NOTREACHED(); |
| 208 } | 209 } |
| 209 | 210 |
| 210 void InstantNTPPrerenderer::NavigateToURL(const content::WebContents* contents, | 211 void InstantNTPPrerenderer::NavigateToURL( |
| 211 const GURL& url, | 212 const content::WebContents* /* contents */, |
| 212 content::PageTransition transition, | 213 const GURL& /* url */, |
| 213 WindowOpenDisposition disposition, | 214 content::PageTransition /* transition */, |
| 214 bool is_search_type) { | 215 WindowOpenDisposition /* disposition */, |
| 216 bool /* is_search_type */) { |
| 215 NOTREACHED(); | 217 NOTREACHED(); |
| 216 } | 218 } |
| 217 | 219 |
| 218 void InstantNTPPrerenderer::DeleteMostVisitedItem(const GURL& url) { | 220 void InstantNTPPrerenderer::PasteIntoOmnibox( |
| 221 const content::WebContents* /* contents */, |
| 222 const string16& /* text */) { |
| 219 NOTREACHED(); | 223 NOTREACHED(); |
| 220 } | 224 } |
| 221 | 225 |
| 222 void InstantNTPPrerenderer::UndoMostVisitedDeletion(const GURL& url) { | 226 void InstantNTPPrerenderer::DeleteMostVisitedItem(const GURL& /* url */) { |
| 223 NOTREACHED(); | 227 NOTREACHED(); |
| 224 } | 228 } |
| 225 | 229 |
| 230 void InstantNTPPrerenderer::UndoMostVisitedDeletion(const GURL& /* url */) { |
| 231 NOTREACHED(); |
| 232 } |
| 233 |
| 226 void InstantNTPPrerenderer::UndoAllMostVisitedDeletions() { | 234 void InstantNTPPrerenderer::UndoAllMostVisitedDeletions() { |
| 227 NOTREACHED(); | 235 NOTREACHED(); |
| 228 } | 236 } |
| 229 | 237 |
| 230 void InstantNTPPrerenderer::InstantPageLoadFailed( | 238 void InstantNTPPrerenderer::InstantPageLoadFailed( |
| 231 content::WebContents* contents) { | 239 content::WebContents* contents) { |
| 232 DCHECK(ntp() && ntp()->contents() == contents); | 240 DCHECK(ntp() && ntp()->contents() == contents); |
| 233 | 241 |
| 234 bool is_local = ntp()->IsLocal(); | 242 bool is_local = ntp()->IsLocal(); |
| 235 DeleteNTPSoon(ntp_.Pass()); | 243 DeleteNTPSoon(ntp_.Pass()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 return false; | 291 return false; |
| 284 | 292 |
| 285 if (PageIsCurrent()) | 293 if (PageIsCurrent()) |
| 286 return false; | 294 return false; |
| 287 | 295 |
| 288 // The preloaded NTP does not support instant yet. If we're not in startup, | 296 // The preloaded NTP does not support instant yet. If we're not in startup, |
| 289 // always fall back to the local NTP. If we are in startup, use the local NTP | 297 // always fall back to the local NTP. If we are in startup, use the local NTP |
| 290 // (unless the finch flag to use the remote NTP is set). | 298 // (unless the finch flag to use the remote NTP is set). |
| 291 return !(InStartup() && chrome::ShouldPreferRemoteNTPOnStartup()); | 299 return !(InStartup() && chrome::ShouldPreferRemoteNTPOnStartup()); |
| 292 } | 300 } |
| OLD | NEW |