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

Side by Side Diff: chrome/browser/ui/search/instant_controller.cc

Issue 12895007: Send onsubmit query down to the instant extended overlay page when a navigation is performed from t… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't send url. Only send for current tab. Created 7 years, 9 months 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 | Annotate | Revision Log
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/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
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::OnNavigateToURL() {
614 if (!extended_enabled_)
615 return;
616
617 if (instant_tab_)
618 instant_tab_->Submit(L"");
sreeram 2013/04/01 16:22:01 Re-using the Submit() method causes a small proble
robertshield 2013/04/01 18:14:49 Ok, I prevented overwriting of the query_ field in
619
620 if (overlay_)
621 overlay_->Submit(L"");
sreeram 2013/04/01 16:22:01 Remove this. We shouldn't need to send any such in
robertshield 2013/04/01 18:14:49 Done.
622 }
623
613 content::WebContents* InstantController::GetOverlayContents() const { 624 content::WebContents* InstantController::GetOverlayContents() const {
614 return overlay_ ? overlay_->contents() : NULL; 625 return overlay_ ? overlay_->contents() : NULL;
615 } 626 }
616 627
617 bool InstantController::IsOverlayingSearchResults() const { 628 bool InstantController::IsOverlayingSearchResults() const {
618 return model_.mode().is_search_suggestions() && IsFullHeight(model_) && 629 return model_.mode().is_search_suggestions() && IsFullHeight(model_) &&
619 (last_match_was_search_ || 630 (last_match_was_search_ ||
620 last_suggestion_.behavior == INSTANT_COMPLETE_NEVER); 631 last_suggestion_.behavior == INSTANT_COMPLETE_NEVER);
621 } 632 }
622 633
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 // for instance, if the user types 'i' and the suggestion is 'INSTANT', 1590 // 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 1591 // suggest 'nstant'. Otherwise, the user text really isn't a prefix, so
1581 // suggest nothing. 1592 // suggest nothing.
1582 // TODO(samarth|jered): revisit this logic. http://crbug.com/196572. 1593 // TODO(samarth|jered): revisit this logic. http://crbug.com/196572.
1583 return true; 1594 return true;
1584 } 1595 }
1585 } 1596 }
1586 1597
1587 return false; 1598 return false;
1588 } 1599 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698