OLD | NEW |
1 // Copyright (c) 2011 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 "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 if (param.value().size() > 2 && | 1265 if (param.value().size() > 2 && |
1266 param.value()[0] == '?' && param.value()[1] == ' ') { | 1266 param.value()[0] == '?' && param.value()[1] == ' ') { |
1267 const TemplateURL* default_provider = | 1267 const TemplateURL* default_provider = |
1268 TemplateURLServiceFactory::GetForProfile(profile)-> | 1268 TemplateURLServiceFactory::GetForProfile(profile)-> |
1269 GetDefaultSearchProvider(); | 1269 GetDefaultSearchProvider(); |
1270 if (default_provider && default_provider->url()) { | 1270 if (default_provider && default_provider->url()) { |
1271 const TemplateURLRef* search_url = default_provider->url(); | 1271 const TemplateURLRef* search_url = default_provider->url(); |
1272 DCHECK(search_url->SupportsReplacement()); | 1272 DCHECK(search_url->SupportsReplacement()); |
1273 string16 search_term = param.LossyDisplayName().substr(2); | 1273 string16 search_term = param.LossyDisplayName().substr(2); |
1274 urls.push_back(GURL(search_url->ReplaceSearchTerms( | 1274 urls.push_back(GURL(search_url->ReplaceSearchTerms( |
1275 *default_provider, search_term, | 1275 profile, *default_provider, search_term, |
1276 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, | 1276 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, |
1277 string16()))); | 1277 string16()))); |
1278 continue; | 1278 continue; |
1279 } | 1279 } |
1280 } | 1280 } |
1281 | 1281 |
1282 // Otherwise, fall through to treating it as a URL. | 1282 // Otherwise, fall through to treating it as a URL. |
1283 | 1283 |
1284 // This will create a file URL or a regular URL. | 1284 // This will create a file URL or a regular URL. |
1285 // This call can (in rare circumstances) block the UI thread. | 1285 // This call can (in rare circumstances) block the UI thread. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 return false; | 1452 return false; |
1453 automation->SetExpectedTabCount(expected_tabs); | 1453 automation->SetExpectedTabCount(expected_tabs); |
1454 | 1454 |
1455 AutomationProviderList* list = | 1455 AutomationProviderList* list = |
1456 g_browser_process->InitAutomationProviderList(); | 1456 g_browser_process->InitAutomationProviderList(); |
1457 DCHECK(list); | 1457 DCHECK(list); |
1458 list->AddProvider(automation); | 1458 list->AddProvider(automation); |
1459 | 1459 |
1460 return true; | 1460 return true; |
1461 } | 1461 } |
OLD | NEW |