OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/api/search_engines_private/search_engines_pr
ivate_api.h" | 5 #include "chrome/browser/extensions/api/search_engines_private/search_engines_pr
ivate_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/prefs/pref_service.h" | |
10 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
11 #include "base/values.h" | 10 #include "base/values.h" |
12 #include "chrome/browser/extensions/chrome_extension_function.h" | 11 #include "chrome/browser/extensions/chrome_extension_function.h" |
13 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/search/hotword_audio_history_handler.h" | 13 #include "chrome/browser/search/hotword_audio_history_handler.h" |
15 #include "chrome/browser/search/hotword_service.h" | 14 #include "chrome/browser/search/hotword_service.h" |
16 #include "chrome/browser/search/hotword_service_factory.h" | 15 #include "chrome/browser/search/hotword_service_factory.h" |
17 #include "chrome/browser/search_engines/template_url_service_factory.h" | 16 #include "chrome/browser/search_engines/template_url_service_factory.h" |
18 #include "chrome/browser/signin/signin_manager_factory.h" | 17 #include "chrome/browser/signin/signin_manager_factory.h" |
19 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
20 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
21 #include "chrome/grit/generated_resources.h" | 20 #include "chrome/grit/generated_resources.h" |
| 21 #include "components/prefs/pref_service.h" |
22 #include "components/search_engines/template_url_service.h" | 22 #include "components/search_engines/template_url_service.h" |
23 #include "components/signin/core/browser/signin_manager.h" | 23 #include "components/signin/core/browser/signin_manager.h" |
24 #include "components/signin/core/browser/signin_manager_base.h" | 24 #include "components/signin/core/browser/signin_manager_base.h" |
25 #include "extensions/browser/extension_function_registry.h" | 25 #include "extensions/browser/extension_function_registry.h" |
26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
27 | 27 |
28 namespace extensions { | 28 namespace extensions { |
29 | 29 |
30 namespace search_engines_private = api::search_engines_private; | 30 namespace search_engines_private = api::search_engines_private; |
31 | 31 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 } else { | 331 } else { |
332 if (prefs->GetBoolean(prefs::kHotwordAlwaysOnSearchEnabled)) | 332 if (prefs->GetBoolean(prefs::kHotwordAlwaysOnSearchEnabled)) |
333 return RespondNow(Error(kAlreadyOptedInError)); | 333 return RespondNow(Error(kAlreadyOptedInError)); |
334 } | 334 } |
335 | 335 |
336 hotword_service->OptIntoHotwording(launch_mode); | 336 hotword_service->OptIntoHotwording(launch_mode); |
337 return RespondNow(NoArguments()); | 337 return RespondNow(NoArguments()); |
338 } | 338 } |
339 | 339 |
340 } // namespace extensions | 340 } // namespace extensions |
OLD | NEW |