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 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 // Handle Vista way of searching - "? <search-term>" | 1291 // Handle Vista way of searching - "? <search-term>" |
1292 if (param.value().size() > 2 && | 1292 if (param.value().size() > 2 && |
1293 param.value()[0] == '?' && param.value()[1] == ' ') { | 1293 param.value()[0] == '?' && param.value()[1] == ' ') { |
1294 const TemplateURL* default_provider = | 1294 const TemplateURL* default_provider = |
1295 TemplateURLServiceFactory::GetForProfile(profile)-> | 1295 TemplateURLServiceFactory::GetForProfile(profile)-> |
1296 GetDefaultSearchProvider(); | 1296 GetDefaultSearchProvider(); |
1297 if (default_provider && default_provider->url()) { | 1297 if (default_provider && default_provider->url()) { |
1298 const TemplateURLRef* search_url = default_provider->url(); | 1298 const TemplateURLRef* search_url = default_provider->url(); |
1299 DCHECK(search_url->SupportsReplacement()); | 1299 DCHECK(search_url->SupportsReplacement()); |
1300 string16 search_term = param.LossyDisplayName().substr(2); | 1300 string16 search_term = param.LossyDisplayName().substr(2); |
1301 urls.push_back(GURL(search_url->ReplaceSearchTerms( | 1301 urls.push_back(GURL(search_url->ReplaceSearchTermsUsingProfile( |
1302 *default_provider, search_term, | 1302 profile, *default_provider, search_term, |
1303 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, | 1303 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()))); |
1304 string16()))); | |
1305 continue; | 1304 continue; |
1306 } | 1305 } |
1307 } | 1306 } |
1308 | 1307 |
1309 // Otherwise, fall through to treating it as a URL. | 1308 // Otherwise, fall through to treating it as a URL. |
1310 | 1309 |
1311 // This will create a file URL or a regular URL. | 1310 // This will create a file URL or a regular URL. |
1312 // This call can (in rare circumstances) block the UI thread. | 1311 // This call can (in rare circumstances) block the UI thread. |
1313 // Allow it until this bug is fixed. | 1312 // Allow it until this bug is fixed. |
1314 // http://code.google.com/p/chromium/issues/detail?id=60641 | 1313 // http://code.google.com/p/chromium/issues/detail?id=60641 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 return false; | 1480 return false; |
1482 automation->SetExpectedTabCount(expected_tabs); | 1481 automation->SetExpectedTabCount(expected_tabs); |
1483 | 1482 |
1484 AutomationProviderList* list = | 1483 AutomationProviderList* list = |
1485 g_browser_process->InitAutomationProviderList(); | 1484 g_browser_process->InitAutomationProviderList(); |
1486 DCHECK(list); | 1485 DCHECK(list); |
1487 list->AddProvider(automation); | 1486 list->AddProvider(automation); |
1488 | 1487 |
1489 return true; | 1488 return true; |
1490 } | 1489 } |
OLD | NEW |