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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 controller_->InstantSupportDetermined(contents(), supports_instant); | 269 controller_->InstantSupportDetermined(contents(), supports_instant); |
270 } | 270 } |
271 | 271 |
272 void InstantLoader::ShowInstantPreview(InstantShownReason reason, | 272 void InstantLoader::ShowInstantPreview(InstantShownReason reason, |
273 int height, | 273 int height, |
274 InstantSizeUnits units) { | 274 InstantSizeUnits units) { |
275 InstantSupportDetermined(true); | 275 InstantSupportDetermined(true); |
276 controller_->ShowInstantPreview(reason, height, units); | 276 controller_->ShowInstantPreview(reason, height, units); |
277 } | 277 } |
278 | 278 |
| 279 void InstantLoader::StartCapturingKeyStrokes() { |
| 280 InstantSupportDetermined(true); |
| 281 controller_->StartCapturingKeyStrokes(); |
| 282 } |
| 283 |
| 284 void InstantLoader::StopCapturingKeyStrokes() { |
| 285 InstantSupportDetermined(true); |
| 286 // NOTE(samarth): the current implementation of the key capturing (invisible |
| 287 // focus) doesn't require doing anything explicitly here. |
| 288 } |
| 289 |
279 void InstantLoader::Observe(int type, | 290 void InstantLoader::Observe(int type, |
280 const content::NotificationSource& source, | 291 const content::NotificationSource& source, |
281 const content::NotificationDetails& details) { | 292 const content::NotificationDetails& details) { |
282 #if defined(OS_MACOSX) | 293 #if defined(OS_MACOSX) |
283 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { | 294 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { |
284 if (content::RenderWidgetHostView* rwhv = | 295 if (content::RenderWidgetHostView* rwhv = |
285 contents_->GetRenderWidgetHostView()) | 296 contents_->GetRenderWidgetHostView()) |
286 rwhv->SetTakesFocusOnlyOnMouseDown(true); | 297 rwhv->SetTakesFocusOnlyOnMouseDown(true); |
287 return; | 298 return; |
288 } | 299 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 content::WebContents* new_contents) { | 371 content::WebContents* new_contents) { |
361 DCHECK_EQ(old_contents, contents()); | 372 DCHECK_EQ(old_contents, contents()); |
362 CleanupPreviewContents(); | 373 CleanupPreviewContents(); |
363 // We release here without deleting so that the caller still has the | 374 // We release here without deleting so that the caller still has the |
364 // responsibility for deleting the WebContents. | 375 // responsibility for deleting the WebContents. |
365 ignore_result(contents_.release()); | 376 ignore_result(contents_.release()); |
366 contents_.reset(new_contents); | 377 contents_.reset(new_contents); |
367 SetupPreviewContents(); | 378 SetupPreviewContents(); |
368 controller_->SwappedWebContents(); | 379 controller_->SwappedWebContents(); |
369 } | 380 } |
OLD | NEW |