OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
11 #include "base/task.h" | 11 #include "base/task.h" |
12 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 12 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
13 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" | 13 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" |
14 #include "chrome/browser/browser_list.h" | 14 #include "chrome/browser/browser_list.h" |
15 #include "chrome/browser/browser_window.h" | 15 #include "chrome/browser/browser_window.h" |
16 #include "chrome/browser/location_bar.h" | 16 #include "chrome/browser/location_bar.h" |
17 #include "chrome/browser/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
18 #include "chrome/browser/profile.h" | 18 #include "chrome/browser/profile.h" |
19 #include "chrome/browser/search_engines/template_url_model.h" | 19 #include "chrome/browser/search_engines/template_url_model.h" |
20 #include "chrome/browser/tab_contents/infobar_delegate.h" | 20 #include "chrome/browser/tab_contents/infobar_delegate.h" |
21 #include "chrome/browser/tab_contents/tab_contents.h" | 21 #include "chrome/browser/tab_contents/tab_contents.h" |
22 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
23 #include "chrome/common/notification_service.h" | 23 #include "chrome/common/notification_service.h" |
24 #include "chrome/common/notification_type.h" | 24 #include "chrome/common/notification_type.h" |
25 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
26 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
27 #include "grit/theme_resources.h" | 27 #include "grit/theme_resources.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 // static | 199 // static |
200 bool OmniboxSearchHint::IsEnabled(Profile* profile) { | 200 bool OmniboxSearchHint::IsEnabled(Profile* profile) { |
201 // The infobar can only be shown if the correct switch has been provided and | 201 // The infobar can only be shown if the correct switch has been provided and |
202 // the user did not dismiss the infobar before. | 202 // the user did not dismiss the infobar before. |
203 return profile->GetPrefs()->GetBoolean(prefs::kShowOmniboxSearchHint) && | 203 return profile->GetPrefs()->GetBoolean(prefs::kShowOmniboxSearchHint) && |
204 CommandLine::ForCurrentProcess()->HasSwitch( | 204 CommandLine::ForCurrentProcess()->HasSwitch( |
205 switches::kSearchInOmniboxHint); | 205 switches::kSearchInOmniboxHint); |
206 } | 206 } |
OLD | NEW |