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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |