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/message_loop.h" |
8 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
9 #include "base/task.h" | 10 #include "base/task.h" |
10 // TODO(avi): remove when conversions not needed any more | 11 // TODO(avi): remove when conversions not needed any more |
11 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/autocomplete/autocomplete.h" | 13 #include "chrome/browser/autocomplete/autocomplete.h" |
13 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 14 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
14 #include "chrome/browser/autocomplete/autocomplete_match.h" | 15 #include "chrome/browser/autocomplete/autocomplete_match.h" |
15 #include "chrome/browser/infobars/infobar_tab_helper.h" | 16 #include "chrome/browser/infobars/infobar_tab_helper.h" |
16 #include "chrome/browser/prefs/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 228 } |
228 | 229 |
229 // static | 230 // static |
230 bool OmniboxSearchHint::IsEnabled(Profile* profile) { | 231 bool OmniboxSearchHint::IsEnabled(Profile* profile) { |
231 // 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 |
232 // the user did not dismiss the infobar before. | 233 // the user did not dismiss the infobar before. |
233 return profile->GetPrefs()->GetBoolean(prefs::kShowOmniboxSearchHint) && | 234 return profile->GetPrefs()->GetBoolean(prefs::kShowOmniboxSearchHint) && |
234 CommandLine::ForCurrentProcess()->HasSwitch( | 235 CommandLine::ForCurrentProcess()->HasSwitch( |
235 switches::kSearchInOmniboxHint); | 236 switches::kSearchInOmniboxHint); |
236 } | 237 } |
OLD | NEW |