| 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/omnibox_search_hint.h" | 5 #include "chrome/browser/omnibox_search_hint.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 // TODO(avi): remove when conversions not needed any more | 10 // TODO(avi): remove when conversions not needed any more |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/ui/browser_list.h" | 21 #include "chrome/browser/ui/browser_list.h" |
| 22 #include "chrome/browser/ui/browser_window.h" | 22 #include "chrome/browser/ui/browser_window.h" |
| 23 #include "chrome/browser/ui/omnibox/location_bar.h" | 23 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 25 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
| 26 #include "content/browser/tab_contents/tab_contents.h" | 26 #include "content/browser/tab_contents/tab_contents.h" |
| 27 #include "content/common/notification_details.h" | 27 #include "content/common/notification_details.h" |
| 28 #include "content/common/notification_source.h" | 28 #include "content/common/notification_source.h" |
| 29 #include "content/common/notification_type.h" | 29 #include "content/common/notification_type.h" |
| 30 #include "grit/generated_resources.h" | 30 #include "grit/generated_resources.h" |
| 31 #include "grit/theme_resources.h" | 31 #include "grit/theme_resources_standard.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 | 34 |
| 35 // The URLs of search engines for which we want to trigger the infobar. | 35 // The URLs of search engines for which we want to trigger the infobar. |
| 36 const char* kSearchEngineURLs[] = { | 36 const char* kSearchEngineURLs[] = { |
| 37 "http://www.google.com/", | 37 "http://www.google.com/", |
| 38 "http://www.yahoo.com/", | 38 "http://www.yahoo.com/", |
| 39 "http://www.bing.com/", | 39 "http://www.bing.com/", |
| 40 "http://www.altavista.com/", | 40 "http://www.altavista.com/", |
| 41 "http://www.ask.com/", | 41 "http://www.ask.com/", |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } | 228 } |
| 229 | 229 |
| 230 // static | 230 // static |
| 231 bool OmniboxSearchHint::IsEnabled(Profile* profile) { | 231 bool OmniboxSearchHint::IsEnabled(Profile* profile) { |
| 232 // The infobar can only be shown if the correct switch has been provided and | 232 // The infobar can only be shown if the correct switch has been provided and |
| 233 // the user did not dismiss the infobar before. | 233 // the user did not dismiss the infobar before. |
| 234 return profile->GetPrefs()->GetBoolean(prefs::kShowOmniboxSearchHint) && | 234 return profile->GetPrefs()->GetBoolean(prefs::kShowOmniboxSearchHint) && |
| 235 CommandLine::ForCurrentProcess()->HasSwitch( | 235 CommandLine::ForCurrentProcess()->HasSwitch( |
| 236 switches::kSearchInOmniboxHint); | 236 switches::kSearchInOmniboxHint); |
| 237 } | 237 } |
| OLD | NEW |