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/ui/search/instant_controller.h" | 5 #include "chrome/browser/ui/search/instant_controller.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 last_omnibox_text_ = full_text; | 603 last_omnibox_text_ = full_text; |
604 last_user_text_ = user_text; | 604 last_user_text_ = user_text; |
605 last_suggestion_ = InstantSuggestion(); | 605 last_suggestion_ = InstantSuggestion(); |
606 | 606 |
607 if (instant_tab_) | 607 if (instant_tab_) |
608 instant_tab_->CancelSelection(full_text); | 608 instant_tab_->CancelSelection(full_text); |
609 else | 609 else |
610 overlay_->CancelSelection(full_text); | 610 overlay_->CancelSelection(full_text); |
611 } | 611 } |
612 | 612 |
| 613 void InstantController::OmniboxNavigateToURL() { |
| 614 if (!extended_enabled_) |
| 615 return; |
| 616 |
| 617 if (instant_tab_) |
| 618 instant_tab_->Submit(string16()); |
| 619 } |
| 620 |
613 content::WebContents* InstantController::GetOverlayContents() const { | 621 content::WebContents* InstantController::GetOverlayContents() const { |
614 return overlay_ ? overlay_->contents() : NULL; | 622 return overlay_ ? overlay_->contents() : NULL; |
615 } | 623 } |
616 | 624 |
617 bool InstantController::IsOverlayingSearchResults() const { | 625 bool InstantController::IsOverlayingSearchResults() const { |
618 return model_.mode().is_search_suggestions() && IsFullHeight(model_) && | 626 return model_.mode().is_search_suggestions() && IsFullHeight(model_) && |
619 (last_match_was_search_ || | 627 (last_match_was_search_ || |
620 last_suggestion_.behavior == INSTANT_COMPLETE_NEVER); | 628 last_suggestion_.behavior == INSTANT_COMPLETE_NEVER); |
621 } | 629 } |
622 | 630 |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 // for instance, if the user types 'i' and the suggestion is 'INSTANT', | 1587 // for instance, if the user types 'i' and the suggestion is 'INSTANT', |
1580 // suggest 'nstant'. Otherwise, the user text really isn't a prefix, so | 1588 // suggest 'nstant'. Otherwise, the user text really isn't a prefix, so |
1581 // suggest nothing. | 1589 // suggest nothing. |
1582 // TODO(samarth|jered): revisit this logic. http://crbug.com/196572. | 1590 // TODO(samarth|jered): revisit this logic. http://crbug.com/196572. |
1583 return true; | 1591 return true; |
1584 } | 1592 } |
1585 } | 1593 } |
1586 | 1594 |
1587 return false; | 1595 return false; |
1588 } | 1596 } |
OLD | NEW |