| 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 #include "chrome/browser/instant/instant_loader.h" | 5 #include "chrome/browser/instant/instant_loader.h" |
| 6 | 6 |
| 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 8 #include "chrome/browser/instant/instant_controller.h" | 8 #include "chrome/browser/instant/instant_controller.h" |
| 9 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" | 9 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" |
| 10 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 10 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 } | 251 } |
| 252 | 252 |
| 253 void InstantLoader::SendThemeAreaHeight(int height) { | 253 void InstantLoader::SendThemeAreaHeight(int height) { |
| 254 client_.SendThemeAreaHeight(height); | 254 client_.SendThemeAreaHeight(height); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void InstantLoader::SetDisplayInstantResults(bool display_instant_results) { | 257 void InstantLoader::SetDisplayInstantResults(bool display_instant_results) { |
| 258 client_.SetDisplayInstantResults(display_instant_results); | 258 client_.SetDisplayInstantResults(display_instant_results); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void InstantLoader::KeyCaptureChanged(bool is_key_capture_enabled) { |
| 262 client_.KeyCaptureChanged(is_key_capture_enabled); |
| 263 } |
| 264 |
| 261 void InstantLoader::SetSuggestions( | 265 void InstantLoader::SetSuggestions( |
| 262 const std::vector<InstantSuggestion>& suggestions) { | 266 const std::vector<InstantSuggestion>& suggestions) { |
| 263 InstantSupportDetermined(true); | 267 InstantSupportDetermined(true); |
| 264 controller_->SetSuggestions(contents(), suggestions); | 268 controller_->SetSuggestions(contents(), suggestions); |
| 265 } | 269 } |
| 266 | 270 |
| 267 void InstantLoader::InstantSupportDetermined(bool supports_instant) { | 271 void InstantLoader::InstantSupportDetermined(bool supports_instant) { |
| 268 // If we had already determined that the page supports Instant, nothing to do. | 272 // If we had already determined that the page supports Instant, nothing to do. |
| 269 if (supports_instant_) | 273 if (supports_instant_) |
| 270 return; | 274 return; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 content::WebContents* new_contents) { | 379 content::WebContents* new_contents) { |
| 376 DCHECK_EQ(old_contents, contents()); | 380 DCHECK_EQ(old_contents, contents()); |
| 377 CleanupPreviewContents(); | 381 CleanupPreviewContents(); |
| 378 // We release here without deleting so that the caller still has the | 382 // We release here without deleting so that the caller still has the |
| 379 // responsibility for deleting the WebContents. | 383 // responsibility for deleting the WebContents. |
| 380 ignore_result(contents_.release()); | 384 ignore_result(contents_.release()); |
| 381 contents_.reset(new_contents); | 385 contents_.reset(new_contents); |
| 382 SetupPreviewContents(); | 386 SetupPreviewContents(); |
| 383 controller_->SwappedWebContents(); | 387 controller_->SwappedWebContents(); |
| 384 } | 388 } |
| OLD | NEW |