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/omnibox_search_hint.h" | 5 #include "chrome/browser/omnibox_search_hint.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
31 #include "content/public/browser/navigation_details.h" | 31 #include "content/public/browser/navigation_details.h" |
32 #include "content/public/browser/navigation_entry.h" | 32 #include "content/public/browser/navigation_entry.h" |
33 #include "content/public/browser/notification_details.h" | 33 #include "content/public/browser/notification_details.h" |
34 #include "content/public/browser/notification_source.h" | 34 #include "content/public/browser/notification_source.h" |
35 #include "content/public/browser/notification_types.h" | 35 #include "content/public/browser/notification_types.h" |
36 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
37 #include "grit/generated_resources.h" | 37 #include "grit/generated_resources.h" |
38 #include "grit/theme_resources_standard.h" | 38 #include "grit/theme_resources.h" |
39 #include "ui/base/l10n/l10n_util.h" | 39 #include "ui/base/l10n/l10n_util.h" |
40 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
41 | 41 |
42 using content::NavigationController; | 42 using content::NavigationController; |
43 using content::NavigationEntry; | 43 using content::NavigationEntry; |
44 | 44 |
45 // The URLs of search engines for which we want to trigger the infobar. | 45 // The URLs of search engines for which we want to trigger the infobar. |
46 const char* const kSearchEngineURLs[] = { | 46 const char* const kSearchEngineURLs[] = { |
47 "http://www.google.com/", | 47 "http://www.google.com/", |
48 "http://www.yahoo.com/", | 48 "http://www.yahoo.com/", |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } | 234 } |
235 | 235 |
236 // static | 236 // static |
237 bool OmniboxSearchHint::IsEnabled(Profile* profile) { | 237 bool OmniboxSearchHint::IsEnabled(Profile* profile) { |
238 // The infobar can only be shown if the correct switch has been provided and | 238 // The infobar can only be shown if the correct switch has been provided and |
239 // the user did not dismiss the infobar before. | 239 // the user did not dismiss the infobar before. |
240 return profile->GetPrefs()->GetBoolean(prefs::kShowOmniboxSearchHint) && | 240 return profile->GetPrefs()->GetBoolean(prefs::kShowOmniboxSearchHint) && |
241 CommandLine::ForCurrentProcess()->HasSwitch( | 241 CommandLine::ForCurrentProcess()->HasSwitch( |
242 switches::kSearchInOmniboxHint); | 242 switches::kSearchInOmniboxHint); |
243 } | 243 } |
OLD | NEW |