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

Side by Side Diff: chrome/renderer/searchbox/searchbox.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: Created 7 years, 8 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
« no previous file with comments | « chrome/browser/ui/search/instant_controller.cc ('k') | no next file » | 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/renderer/searchbox/searchbox.h" 5 #include "chrome/renderer/searchbox/searchbox.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/common/render_messages.h" 8 #include "chrome/common/render_messages.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "chrome/renderer/searchbox/searchbox_extension.h" 10 #include "chrome/renderer/searchbox/searchbox_extension.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 selection_start_ = selection_start; 187 selection_start_ = selection_start;
188 selection_end_ = selection_end; 188 selection_end_ = selection_end;
189 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { 189 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
190 DVLOG(1) << render_view() << " OnChange"; 190 DVLOG(1) << render_view() << " OnChange";
191 extensions_v8::SearchBoxExtension::DispatchChange( 191 extensions_v8::SearchBoxExtension::DispatchChange(
192 render_view()->GetWebView()->mainFrame()); 192 render_view()->GetWebView()->mainFrame());
193 } 193 }
194 } 194 }
195 195
196 void SearchBox::OnSubmit(const string16& query) { 196 void SearchBox::OnSubmit(const string16& query) {
197 query_ = query; 197 if (!query.empty()) {
198 query_ = query;
199 }
200
198 verbatim_ = true; 201 verbatim_ = true;
199 selection_start_ = selection_end_ = query_.size(); 202 selection_start_ = selection_end_ = query_.size();
sreeram 2013/04/01 20:08:46 Put all these other things also into the 'if' bloc
robertshield 2013/04/08 16:02:47 Done.
200 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { 203 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
201 DVLOG(1) << render_view() << " OnSubmit"; 204 DVLOG(1) << render_view() << " OnSubmit";
202 extensions_v8::SearchBoxExtension::DispatchSubmit( 205 extensions_v8::SearchBoxExtension::DispatchSubmit(
203 render_view()->GetWebView()->mainFrame()); 206 render_view()->GetWebView()->mainFrame());
204 } 207 }
205 Reset(); 208 Reset();
206 } 209 }
207 210
208 void SearchBox::OnCancel(const string16& query) { 211 void SearchBox::OnCancel(const string16& query) {
209 query_ = query; 212 query_ = query;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { 371 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
369 extensions_v8::SearchBoxExtension::DispatchMostVisitedChanged( 372 extensions_v8::SearchBoxExtension::DispatchMostVisitedChanged(
370 render_view()->GetWebView()->mainFrame()); 373 render_view()->GetWebView()->mainFrame());
371 } 374 }
372 } 375 }
373 376
374 const std::vector<InstantMostVisitedItem>& 377 const std::vector<InstantMostVisitedItem>&
375 SearchBox::GetMostVisitedItems() const { 378 SearchBox::GetMostVisitedItems() const {
376 return most_visited_items_; 379 return most_visited_items_;
377 } 380 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698