OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/ui/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Handle Vista way of searching - "? <search-term>" | 269 // Handle Vista way of searching - "? <search-term>" |
270 if (param.value().size() > 2 && | 270 if (param.value().size() > 2 && |
271 param.value()[0] == '?' && param.value()[1] == ' ') { | 271 param.value()[0] == '?' && param.value()[1] == ' ') { |
272 const TemplateURL* default_provider = | 272 const TemplateURL* default_provider = |
273 TemplateURLServiceFactory::GetForProfile(profile)-> | 273 TemplateURLServiceFactory::GetForProfile(profile)-> |
274 GetDefaultSearchProvider(); | 274 GetDefaultSearchProvider(); |
275 if (default_provider) { | 275 if (default_provider) { |
276 const TemplateURLRef& search_url = default_provider->url_ref(); | 276 const TemplateURLRef& search_url = default_provider->url_ref(); |
277 DCHECK(search_url.SupportsReplacement()); | 277 DCHECK(search_url.SupportsReplacement()); |
278 string16 search_term = param.LossyDisplayName().substr(2); | 278 string16 search_term = param.LossyDisplayName().substr(2); |
279 urls.push_back(GURL(search_url.ReplaceSearchTerms(search_term, | 279 urls.push_back(GURL(search_url.ReplaceSearchTerms( |
280 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()))); | 280 TemplateURLRef::SearchTermsArgs(search_term)))); |
281 continue; | 281 continue; |
282 } | 282 } |
283 } | 283 } |
284 | 284 |
285 // Otherwise, fall through to treating it as a URL. | 285 // Otherwise, fall through to treating it as a URL. |
286 | 286 |
287 // This will create a file URL or a regular URL. | 287 // This will create a file URL or a regular URL. |
288 // This call can (in rare circumstances) block the UI thread. | 288 // This call can (in rare circumstances) block the UI thread. |
289 // Allow it until this bug is fixed. | 289 // Allow it until this bug is fixed. |
290 // http://code.google.com/p/chromium/issues/detail?id=60641 | 290 // http://code.google.com/p/chromium/issues/detail?id=60641 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 NOTREACHED(); | 555 NOTREACHED(); |
556 return; | 556 return; |
557 } | 557 } |
558 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); | 558 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); |
559 } | 559 } |
560 | 560 |
561 bool HasPendingUncleanExit(Profile* profile) { | 561 bool HasPendingUncleanExit(Profile* profile) { |
562 return !profile->DidLastSessionExitCleanly() && | 562 return !profile->DidLastSessionExitCleanly() && |
563 !profile_launch_observer.Get().HasBeenLaunched(profile); | 563 !profile_launch_observer.Get().HasBeenLaunched(profile); |
564 } | 564 } |
565 | |
OLD | NEW |