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

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

Issue 11369137: Implement {Start,Stop}CapturingKeyStrokes for Instant. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Added comment. 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
« no previous file with comments | « chrome/browser/instant/instant_controller.h ('k') | chrome/browser/instant/instant_loader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_controller.h" 5 #include "chrome/browser/instant/instant_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 735 }
736 } 736 }
737 737
738 void InstantController::ShowInstantPreview(InstantShownReason reason, 738 void InstantController::ShowInstantPreview(InstantShownReason reason,
739 int height, 739 int height,
740 InstantSizeUnits units) { 740 InstantSizeUnits units) {
741 if (extended_enabled_) 741 if (extended_enabled_)
742 ShowLoader(reason, height, units); 742 ShowLoader(reason, height, units);
743 } 743 }
744 744
745 void InstantController::StartCapturingKeyStrokes() {
746 // Ignore unless the loader is active and on the NTP.
747 if (extended_enabled_ && !instant_tab_ && model_.mode().is_ntp())
748 browser_->FocusOmniboxInvisibly();
749 }
750
745 void InstantController::SwappedWebContents() { 751 void InstantController::SwappedWebContents() {
746 model_.SetPreviewContents(GetPreviewContents()); 752 model_.SetPreviewContents(GetPreviewContents());
747 } 753 }
748 754
749 void InstantController::InstantLoaderContentsFocused() { 755 void InstantController::InstantLoaderContentsFocused() {
750 #if defined(USE_AURA) 756 #if defined(USE_AURA)
751 // On aura the omnibox only receives a focus lost if we initiate the focus 757 // On aura the omnibox only receives a focus lost if we initiate the focus
752 // change. This does that. 758 // change. This does that.
753 if (!model_.mode().is_default()) 759 if (!model_.mode().is_default())
754 browser_->InstantPreviewFocused(); 760 browser_->InstantPreviewFocused();
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 } 1000 }
995 1001
996 std::map<std::string, int>::const_iterator iter = 1002 std::map<std::string, int>::const_iterator iter =
997 blacklisted_urls_.find(*instant_url); 1003 blacklisted_urls_.find(*instant_url);
998 if (iter != blacklisted_urls_.end() && 1004 if (iter != blacklisted_urls_.end() &&
999 iter->second > kMaxInstantSupportFailures) 1005 iter->second > kMaxInstantSupportFailures)
1000 return false; 1006 return false;
1001 1007
1002 return true; 1008 return true;
1003 } 1009 }
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_controller.h ('k') | chrome/browser/instant/instant_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698