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

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

Issue 105493002: Use base namespace for string16 in chrome/renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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.h » ('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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 156
157 SearchBox::~SearchBox() { 157 SearchBox::~SearchBox() {
158 } 158 }
159 159
160 void SearchBox::LogEvent(NTPLoggingEventType event) { 160 void SearchBox::LogEvent(NTPLoggingEventType event) {
161 render_view()->Send(new ChromeViewHostMsg_LogEvent( 161 render_view()->Send(new ChromeViewHostMsg_LogEvent(
162 render_view()->GetRoutingID(), render_view()->GetPageId(), event)); 162 render_view()->GetRoutingID(), render_view()->GetPageId(), event));
163 } 163 }
164 164
165 void SearchBox::CheckIsUserSignedInToChromeAs(const string16& identity) { 165 void SearchBox::CheckIsUserSignedInToChromeAs(const base::string16& identity) {
166 render_view()->Send(new ChromeViewHostMsg_ChromeIdentityCheck( 166 render_view()->Send(new ChromeViewHostMsg_ChromeIdentityCheck(
167 render_view()->GetRoutingID(), render_view()->GetPageId(), identity)); 167 render_view()->GetRoutingID(), render_view()->GetPageId(), identity));
168 } 168 }
169 169
170 void SearchBox::DeleteMostVisitedItem( 170 void SearchBox::DeleteMostVisitedItem(
171 InstantRestrictedID most_visited_item_id) { 171 InstantRestrictedID most_visited_item_id) {
172 render_view()->Send(new ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem( 172 render_view()->Send(new ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem(
173 render_view()->GetRoutingID(), render_view()->GetPageId(), 173 render_view()->GetRoutingID(), render_view()->GetPageId(),
174 GetURLForMostVisitedItem(most_visited_item_id))); 174 GetURLForMostVisitedItem(most_visited_item_id)));
175 } 175 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 } 233 }
234 234
235 void SearchBox::NavigateToURL(const GURL& url, 235 void SearchBox::NavigateToURL(const GURL& url,
236 WindowOpenDisposition disposition, 236 WindowOpenDisposition disposition,
237 bool is_most_visited_item_url) { 237 bool is_most_visited_item_url) {
238 render_view()->Send(new ChromeViewHostMsg_SearchBoxNavigate( 238 render_view()->Send(new ChromeViewHostMsg_SearchBoxNavigate(
239 render_view()->GetRoutingID(), render_view()->GetPageId(), url, 239 render_view()->GetRoutingID(), render_view()->GetPageId(), url,
240 disposition, is_most_visited_item_url)); 240 disposition, is_most_visited_item_url));
241 } 241 }
242 242
243 void SearchBox::Paste(const string16& text) { 243 void SearchBox::Paste(const base::string16& text) {
244 render_view()->Send(new ChromeViewHostMsg_PasteAndOpenDropdown( 244 render_view()->Send(new ChromeViewHostMsg_PasteAndOpenDropdown(
245 render_view()->GetRoutingID(), render_view()->GetPageId(), text)); 245 render_view()->GetRoutingID(), render_view()->GetPageId(), text));
246 } 246 }
247 247
248 void SearchBox::SetVoiceSearchSupported(bool supported) { 248 void SearchBox::SetVoiceSearchSupported(bool supported) {
249 render_view()->Send(new ChromeViewHostMsg_SetVoiceSearchSupported( 249 render_view()->Send(new ChromeViewHostMsg_SetVoiceSearchSupported(
250 render_view()->GetRoutingID(), render_view()->GetPageId(), supported)); 250 render_view()->GetRoutingID(), render_view()->GetPageId(), supported));
251 } 251 }
252 252
253 void SearchBox::StartCapturingKeyStrokes() { 253 void SearchBox::StartCapturingKeyStrokes() {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxSubmit, OnSubmit) 297 IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxSubmit, OnSubmit)
298 IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxThemeChanged, 298 IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxThemeChanged,
299 OnThemeChanged) 299 OnThemeChanged)
300 IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxToggleVoiceSearch, 300 IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxToggleVoiceSearch,
301 OnToggleVoiceSearch) 301 OnToggleVoiceSearch)
302 IPC_MESSAGE_UNHANDLED(handled = false) 302 IPC_MESSAGE_UNHANDLED(handled = false)
303 IPC_END_MESSAGE_MAP() 303 IPC_END_MESSAGE_MAP()
304 return handled; 304 return handled;
305 } 305 }
306 306
307 void SearchBox::OnChromeIdentityCheckResult(const string16& identity, 307 void SearchBox::OnChromeIdentityCheckResult(const base::string16& identity,
308 bool identity_match) { 308 bool identity_match) {
309 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { 309 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
310 extensions_v8::SearchBoxExtension::DispatchChromeIdentityCheckResult( 310 extensions_v8::SearchBoxExtension::DispatchChromeIdentityCheckResult(
311 render_view()->GetWebView()->mainFrame(), identity, identity_match); 311 render_view()->GetWebView()->mainFrame(), identity, identity_match);
312 } 312 }
313 } 313 }
314 314
315 void SearchBox::OnDetermineIfPageSupportsInstant() { 315 void SearchBox::OnDetermineIfPageSupportsInstant() {
316 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { 316 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
317 bool result = extensions_v8::SearchBoxExtension::PageSupportsInstant( 317 bool result = extensions_v8::SearchBoxExtension::PageSupportsInstant(
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 void SearchBox::OnSetSuggestionToPrefetch(const InstantSuggestion& suggestion) { 407 void SearchBox::OnSetSuggestionToPrefetch(const InstantSuggestion& suggestion) {
408 suggestion_ = suggestion; 408 suggestion_ = suggestion;
409 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { 409 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
410 DVLOG(1) << render_view() << " OnSetSuggestionToPrefetch"; 410 DVLOG(1) << render_view() << " OnSetSuggestionToPrefetch";
411 extensions_v8::SearchBoxExtension::DispatchSuggestionChange( 411 extensions_v8::SearchBoxExtension::DispatchSuggestionChange(
412 render_view()->GetWebView()->mainFrame()); 412 render_view()->GetWebView()->mainFrame());
413 } 413 }
414 } 414 }
415 415
416 void SearchBox::OnSubmit(const string16& query) { 416 void SearchBox::OnSubmit(const base::string16& query) {
417 query_ = query; 417 query_ = query;
418 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { 418 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
419 DVLOG(1) << render_view() << " OnSubmit"; 419 DVLOG(1) << render_view() << " OnSubmit";
420 extensions_v8::SearchBoxExtension::DispatchSubmit( 420 extensions_v8::SearchBoxExtension::DispatchSubmit(
421 render_view()->GetWebView()->mainFrame()); 421 render_view()->GetWebView()->mainFrame());
422 } 422 }
423 if (!query.empty()) 423 if (!query.empty())
424 Reset(); 424 Reset();
425 } 425 }
426 426
(...skipping 23 matching lines...) Expand all
450 450
451 void SearchBox::Reset() { 451 void SearchBox::Reset() {
452 query_.clear(); 452 query_.clear();
453 suggestion_ = InstantSuggestion(); 453 suggestion_ = InstantSuggestion();
454 start_margin_ = 0; 454 start_margin_ = 0;
455 width_ = 0; 455 width_ = 0;
456 is_focused_ = false; 456 is_focused_ = false;
457 is_key_capture_enabled_ = false; 457 is_key_capture_enabled_ = false;
458 theme_info_ = ThemeBackgroundInfo(); 458 theme_info_ = ThemeBackgroundInfo();
459 } 459 }
OLDNEW
« no previous file with comments | « chrome/renderer/searchbox/searchbox.h ('k') | chrome/renderer/searchbox/searchbox_extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698