Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: chrome/browser/instant/instant_loader.cc

Issue 11413217: Instant API: tell page whether the browser is capturing key strokes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@focus
Patch Set: Rebase and refactor. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 247 }
248 248
249 void InstantLoader::SendThemeAreaHeight(int height) { 249 void InstantLoader::SendThemeAreaHeight(int height) {
250 client_.SendThemeAreaHeight(height); 250 client_.SendThemeAreaHeight(height);
251 } 251 }
252 252
253 void InstantLoader::SetDisplayInstantResults(bool display_instant_results) { 253 void InstantLoader::SetDisplayInstantResults(bool display_instant_results) {
254 client_.SetDisplayInstantResults(display_instant_results); 254 client_.SetDisplayInstantResults(display_instant_results);
255 } 255 }
256 256
257 void InstantLoader::KeyCaptureChanged(bool is_key_capture_enabled) {
258 client_.KeyCaptureChanged(is_key_capture_enabled);
259 }
260
257 void InstantLoader::SetSuggestions( 261 void InstantLoader::SetSuggestions(
258 const std::vector<InstantSuggestion>& suggestions) { 262 const std::vector<InstantSuggestion>& suggestions) {
259 InstantSupportDetermined(true); 263 InstantSupportDetermined(true);
260 controller_->SetSuggestions(contents(), suggestions); 264 controller_->SetSuggestions(contents(), suggestions);
261 } 265 }
262 266
263 void InstantLoader::InstantSupportDetermined(bool supports_instant) { 267 void InstantLoader::InstantSupportDetermined(bool supports_instant) {
264 // If we had already determined that the page supports Instant, nothing to do. 268 // If we had already determined that the page supports Instant, nothing to do.
265 if (supports_instant_) 269 if (supports_instant_)
266 return; 270 return;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 content::WebContents* new_contents) { 375 content::WebContents* new_contents) {
372 DCHECK_EQ(old_contents, contents()); 376 DCHECK_EQ(old_contents, contents());
373 CleanupPreviewContents(); 377 CleanupPreviewContents();
374 // We release here without deleting so that the caller still has the 378 // We release here without deleting so that the caller still has the
375 // responsibility for deleting the WebContents. 379 // responsibility for deleting the WebContents.
376 ignore_result(contents_.release()); 380 ignore_result(contents_.release());
377 contents_.reset(new_contents); 381 contents_.reset(new_contents);
378 SetupPreviewContents(); 382 SetupPreviewContents();
379 controller_->SwappedWebContents(); 383 controller_->SwappedWebContents();
380 } 384 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698