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

Side by Side Diff: chrome/browser/ui/browser_init.cc

Issue 6322001: Remove wstring from TemplateURL and friends.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_init.h" 5 #include "chrome/browser/ui/browser_init.h"
6 6
7 #include <algorithm> // For max(). 7 #include <algorithm> // For max().
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
11 #include "base/environment.h" 11 #include "base/environment.h"
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 profile->GetTemplateURLModel()->GetDefaultSearchProvider(); 879 profile->GetTemplateURLModel()->GetDefaultSearchProvider();
880 if (!default_provider || !default_provider->url()) { 880 if (!default_provider || !default_provider->url()) {
881 // No search provider available. Just treat this as regular URL. 881 // No search provider available. Just treat this as regular URL.
882 urls.push_back(URLFixerUpper::FixupRelativeFile(cur_dir_, param)); 882 urls.push_back(URLFixerUpper::FixupRelativeFile(cur_dir_, param));
883 continue; 883 continue;
884 } 884 }
885 const TemplateURLRef* search_url = default_provider->url(); 885 const TemplateURLRef* search_url = default_provider->url();
886 DCHECK(search_url->SupportsReplacement()); 886 DCHECK(search_url->SupportsReplacement());
887 std::wstring search_term = param.ToWStringHack().substr(2); 887 std::wstring search_term = param.ToWStringHack().substr(2);
888 urls.push_back(GURL(search_url->ReplaceSearchTerms( 888 urls.push_back(GURL(search_url->ReplaceSearchTerms(
889 *default_provider, search_term, 889 *default_provider, WideToUTF16Hack(search_term),
890 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); 890 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())));
891 } else { 891 } else {
892 // This will create a file URL or a regular URL. 892 // This will create a file URL or a regular URL.
893 // This call can (in rare circumstances) block the UI thread. 893 // This call can (in rare circumstances) block the UI thread.
894 // Allow it until this bug is fixed. 894 // Allow it until this bug is fixed.
895 // http://code.google.com/p/chromium/issues/detail?id=60641 895 // http://code.google.com/p/chromium/issues/detail?id=60641
896 GURL url; 896 GURL url;
897 { 897 {
898 base::ThreadRestrictions::ScopedAllowIO allow_io; 898 base::ThreadRestrictions::ScopedAllowIO allow_io;
899 url = URLFixerUpper::FixupRelativeFile(cur_dir_, param); 899 url = URLFixerUpper::FixupRelativeFile(cur_dir_, param);
900 } 900 }
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 return false; 1096 return false;
1097 automation->SetExpectedTabCount(expected_tabs); 1097 automation->SetExpectedTabCount(expected_tabs);
1098 1098
1099 AutomationProviderList* list = 1099 AutomationProviderList* list =
1100 g_browser_process->InitAutomationProviderList(); 1100 g_browser_process->InitAutomationProviderList();
1101 DCHECK(list); 1101 DCHECK(list);
1102 list->AddProvider(automation); 1102 list->AddProvider(automation);
1103 1103
1104 return true; 1104 return true;
1105 } 1105 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.cc ('k') | chrome/browser/ui/cocoa/edit_search_engine_cocoa_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698