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_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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
611 if (loader_ == loader) | 611 if (loader_ == loader) |
612 DeleteLoader(); | 612 DeleteLoader(); |
613 } | 613 } |
614 | 614 |
615 content::NotificationService::current()->Notify( | 615 content::NotificationService::current()->Notify( |
616 chrome::NOTIFICATION_INSTANT_SUPPORT_DETERMINED, | 616 chrome::NOTIFICATION_INSTANT_SUPPORT_DETERMINED, |
617 content::Source<InstantController>(this), | 617 content::Source<InstantController>(this), |
618 content::NotificationService::NoDetails()); | 618 content::NotificationService::NoDetails()); |
619 } | 619 } |
620 | 620 |
621 void InstantController::OnWebSearchBoxFocusChange(InstantLoader* loader, | |
622 bool is_focused) { | |
623 if (loader_ == loader && extended_enabled_ && | |
624 model_.mode().is_ntp() && is_focused) | |
625 browser_->SetInvisibleFocus(); | |
dhollowa
2012/11/20 23:50:17
I assume defocusing the fakebox by clicking elsewh
samarth
2012/11/21 00:40:15
Yes, that's handled as it is normally.
| |
626 } | |
627 | |
621 void InstantController::SwappedTabContents(InstantLoader* loader) { | 628 void InstantController::SwappedTabContents(InstantLoader* loader) { |
622 if (loader_ == loader) | 629 if (loader_ == loader) |
623 model_.SetPreviewContents(GetPreviewContents()); | 630 model_.SetPreviewContents(GetPreviewContents()); |
624 } | 631 } |
625 | 632 |
626 void InstantController::InstantLoaderContentsFocused(InstantLoader* loader) { | 633 void InstantController::InstantLoaderContentsFocused(InstantLoader* loader) { |
627 #if defined(USE_AURA) | 634 #if defined(USE_AURA) |
628 // On aura the omnibox only receives a focus lost if we initiate the focus | 635 // On aura the omnibox only receives a focus lost if we initiate the focus |
629 // change. This does that. | 636 // change. This does that. |
630 if (!model_.mode().is_default()) | 637 if (!model_.mode().is_default()) |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
827 } | 834 } |
828 | 835 |
829 std::map<std::string, int>::const_iterator iter = | 836 std::map<std::string, int>::const_iterator iter = |
830 blacklisted_urls_.find(*instant_url); | 837 blacklisted_urls_.find(*instant_url); |
831 if (iter != blacklisted_urls_.end() && | 838 if (iter != blacklisted_urls_.end() && |
832 iter->second > kMaxInstantSupportFailures) | 839 iter->second > kMaxInstantSupportFailures) |
833 return false; | 840 return false; |
834 | 841 |
835 return true; | 842 return true; |
836 } | 843 } |
OLD | NEW |