| 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_overlay.h" | 5 #include "chrome/browser/ui/search/instant_overlay.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/supports_user_data.h" | 8 #include "base/supports_user_data.h" |
| 9 #include "chrome/browser/search/search.h" | 9 #include "chrome/browser/search/search.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // static | 34 // static |
| 35 InstantOverlay* InstantOverlay::FromWebContents( | 35 InstantOverlay* InstantOverlay::FromWebContents( |
| 36 const content::WebContents* web_contents) { | 36 const content::WebContents* web_contents) { |
| 37 InstantOverlayUserData* data = static_cast<InstantOverlayUserData*>( | 37 InstantOverlayUserData* data = static_cast<InstantOverlayUserData*>( |
| 38 web_contents->GetUserData(&kUserDataKey)); | 38 web_contents->GetUserData(&kUserDataKey)); |
| 39 return data ? data->overlay() : NULL; | 39 return data ? data->overlay() : NULL; |
| 40 } | 40 } |
| 41 | 41 |
| 42 InstantOverlay::InstantOverlay(InstantController* controller, | 42 InstantOverlay::InstantOverlay(InstantController* controller, |
| 43 const std::string& instant_url) | 43 const std::string& instant_url, |
| 44 : InstantPage(controller, instant_url), | 44 bool off_the_record) |
| 45 : InstantPage(controller, instant_url, off_the_record), |
| 45 loader_(this), | 46 loader_(this), |
| 46 is_stale_(false), | 47 is_stale_(false), |
| 47 is_pointer_down_from_activate_(false) { | 48 is_pointer_down_from_activate_(false) { |
| 48 } | 49 } |
| 49 | 50 |
| 50 InstantOverlay::~InstantOverlay() { | 51 InstantOverlay::~InstantOverlay() { |
| 51 } | 52 } |
| 52 | 53 |
| 53 void InstantOverlay::InitContents(Profile* profile, | 54 void InstantOverlay::InitContents(Profile* profile, |
| 54 const content::WebContents* active_tab) { | 55 const content::WebContents* active_tab) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 163 } |
| 163 | 164 |
| 164 void InstantOverlay::LoadCompletedMainFrame() { | 165 void InstantOverlay::LoadCompletedMainFrame() { |
| 165 instant_controller()->OverlayLoadCompletedMainFrame(); | 166 instant_controller()->OverlayLoadCompletedMainFrame(); |
| 166 } | 167 } |
| 167 | 168 |
| 168 void InstantOverlay::HandleStalePage() { | 169 void InstantOverlay::HandleStalePage() { |
| 169 is_stale_ = true; | 170 is_stale_ = true; |
| 170 instant_controller()->ReloadOverlayIfStale(); | 171 instant_controller()->ReloadOverlayIfStale(); |
| 171 } | 172 } |
| OLD | NEW |