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

Side by Side Diff: chrome/browser/search_engines/util.cc

Issue 2822026: Mac: First run bubble. (Closed)
Patch Set: '' Created 10 years, 5 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
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/search_engines/util.h"
6
7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/search_engines/template_url_model.h"
9 #include "chrome/browser/profile.h"
10
11 string16 GetDefaultSearchEngineName(Profile* profile) {
12 if (!profile) {
13 NOTREACHED();
14 return string16();
15 }
16 const TemplateURL* const default_provider =
17 profile->GetTemplateURLModel()->GetDefaultSearchProvider();
18 if (!default_provider) {
19 // TODO(cpu): bug 1187517. It is possible to have no default provider.
20 // returning an empty string is a stopgap measure for the crash
21 // http://code.google.com/p/chromium/issues/detail?id=2573
22 return string16();
23 }
24 return WideToUTF16(default_provider->short_name());
25 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698