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

Side by Side Diff: chrome/renderer/searchbox/searchbox.cc

Issue 23462014: InstantExtended: add back focus() API call. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix semi-colon. Created 7 years, 3 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/renderer/searchbox/searchbox.h ('k') | chrome/renderer/searchbox/searchbox_extension.cc » ('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/renderer/searchbox/searchbox.h" 5 #include "chrome/renderer/searchbox/searchbox.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 InstantRestrictedID most_visited_item_id, 216 InstantRestrictedID most_visited_item_id,
217 InstantMostVisitedItem* item) const { 217 InstantMostVisitedItem* item) const {
218 return most_visited_items_cache_.GetItemWithRestrictedID(most_visited_item_id, 218 return most_visited_items_cache_.GetItemWithRestrictedID(most_visited_item_id,
219 item); 219 item);
220 } 220 }
221 221
222 const ThemeBackgroundInfo& SearchBox::GetThemeBackgroundInfo() { 222 const ThemeBackgroundInfo& SearchBox::GetThemeBackgroundInfo() {
223 return theme_info_; 223 return theme_info_;
224 } 224 }
225 225
226 void SearchBox::Focus() {
227 render_view()->Send(new ChromeViewHostMsg_FocusOmnibox(
228 render_view()->GetRoutingID(), render_view()->GetPageId(),
229 OMNIBOX_FOCUS_VISIBLE));
230 }
231
226 void SearchBox::NavigateToURL(const GURL& url, 232 void SearchBox::NavigateToURL(const GURL& url,
227 content::PageTransition transition, 233 content::PageTransition transition,
228 WindowOpenDisposition disposition, 234 WindowOpenDisposition disposition,
229 bool is_search_type) { 235 bool is_search_type) {
230 render_view()->Send(new ChromeViewHostMsg_SearchBoxNavigate( 236 render_view()->Send(new ChromeViewHostMsg_SearchBoxNavigate(
231 render_view()->GetRoutingID(), render_view()->GetPageId(), 237 render_view()->GetRoutingID(), render_view()->GetPageId(),
232 url, transition, disposition, is_search_type)); 238 url, transition, disposition, is_search_type));
233 } 239 }
234 240
235 void SearchBox::Paste(const string16& text) { 241 void SearchBox::Paste(const string16& text) {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 446
441 void SearchBox::Reset() { 447 void SearchBox::Reset() {
442 query_.clear(); 448 query_.clear();
443 suggestion_ = InstantSuggestion(); 449 suggestion_ = InstantSuggestion();
444 start_margin_ = 0; 450 start_margin_ = 0;
445 width_ = 0; 451 width_ = 0;
446 is_focused_ = false; 452 is_focused_ = false;
447 is_key_capture_enabled_ = false; 453 is_key_capture_enabled_ = false;
448 theme_info_ = ThemeBackgroundInfo(); 454 theme_info_ = ThemeBackgroundInfo();
449 } 455 }
OLDNEW
« no previous file with comments | « chrome/renderer/searchbox/searchbox.h ('k') | chrome/renderer/searchbox/searchbox_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698