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(contents()); | |
282 } | |
283 | |
284 void InstantLoader::StopCapturingKeyStrokes() { | |
285 InstantSupportDetermined(true); | |
286 // NOTE(samarth): we don't do anything else yet in this case. | |
sreeram
2012/12/04 21:54:58
Should this be a "TODO(samarth): Do something" ins
samarth
2012/12/04 22:13:43
Expanded the comment.
| |
287 } | |
288 | |
279 void InstantLoader::Observe(int type, | 289 void InstantLoader::Observe(int type, |
280 const content::NotificationSource& source, | 290 const content::NotificationSource& source, |
281 const content::NotificationDetails& details) { | 291 const content::NotificationDetails& details) { |
282 #if defined(OS_MACOSX) | 292 #if defined(OS_MACOSX) |
283 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { | 293 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { |
284 if (content::RenderWidgetHostView* rwhv = | 294 if (content::RenderWidgetHostView* rwhv = |
285 contents_->GetRenderWidgetHostView()) | 295 contents_->GetRenderWidgetHostView()) |
286 rwhv->SetTakesFocusOnlyOnMouseDown(true); | 296 rwhv->SetTakesFocusOnlyOnMouseDown(true); |
287 return; | 297 return; |
288 } | 298 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 content::WebContents* new_contents) { | 370 content::WebContents* new_contents) { |
361 DCHECK_EQ(old_contents, contents()); | 371 DCHECK_EQ(old_contents, contents()); |
362 CleanupPreviewContents(); | 372 CleanupPreviewContents(); |
363 // We release here without deleting so that the caller still has the | 373 // We release here without deleting so that the caller still has the |
364 // responsibility for deleting the WebContents. | 374 // responsibility for deleting the WebContents. |
365 ignore_result(contents_.release()); | 375 ignore_result(contents_.release()); |
366 contents_.reset(new_contents); | 376 contents_.reset(new_contents); |
367 SetupPreviewContents(); | 377 SetupPreviewContents(); |
368 controller_->SwappedWebContents(); | 378 controller_->SwappedWebContents(); |
369 } | 379 } |
OLD | NEW |