Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: chrome/browser/search/hotword_service.cc

Issue 469993006: Use a qualified path for chromium_strings, google_chrome_strings, and generated_resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/search/hotword_service.h" 5 #include "chrome/browser/search/hotword_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/i18n/case_conversion.h" 8 #include "base/i18n/case_conversion.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
15 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h" 15 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h"
16 #include "chrome/browser/extensions/extension_service.h" 16 #include "chrome/browser/extensions/extension_service.h"
17 #include "chrome/browser/extensions/pending_extension_manager.h" 17 #include "chrome/browser/extensions/pending_extension_manager.h"
18 #include "chrome/browser/extensions/updater/extension_updater.h" 18 #include "chrome/browser/extensions/updater/extension_updater.h"
19 #include "chrome/browser/extensions/webstore_startup_installer.h" 19 #include "chrome/browser/extensions/webstore_startup_installer.h"
20 #include "chrome/browser/plugins/plugin_prefs.h" 20 #include "chrome/browser/plugins/plugin_prefs.h"
21 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/search/hotword_service_factory.h" 22 #include "chrome/browser/search/hotword_service_factory.h"
23 #include "chrome/common/chrome_paths.h" 23 #include "chrome/common/chrome_paths.h"
24 #include "chrome/common/chrome_switches.h" 24 #include "chrome/common/chrome_switches.h"
25 #include "chrome/common/extensions/extension_constants.h" 25 #include "chrome/common/extensions/extension_constants.h"
26 #include "chrome/common/pref_names.h" 26 #include "chrome/common/pref_names.h"
27 #include "chrome/grit/generated_resources.h"
27 #include "content/public/browser/browser_thread.h" 28 #include "content/public/browser/browser_thread.h"
28 #include "content/public/browser/notification_service.h" 29 #include "content/public/browser/notification_service.h"
29 #include "content/public/browser/plugin_service.h" 30 #include "content/public/browser/plugin_service.h"
30 #include "content/public/common/webplugininfo.h" 31 #include "content/public/common/webplugininfo.h"
31 #include "extensions/browser/extension_system.h" 32 #include "extensions/browser/extension_system.h"
32 #include "extensions/browser/uninstall_reason.h" 33 #include "extensions/browser/uninstall_reason.h"
33 #include "extensions/common/extension.h" 34 #include "extensions/common/extension.h"
34 #include "extensions/common/one_shot_event.h" 35 #include "extensions/common/one_shot_event.h"
35 #include "grit/generated_resources.h"
36 #include "ui/base/l10n/l10n_util.h" 36 #include "ui/base/l10n/l10n_util.h"
37 37
38 using extensions::BrowserContextKeyedAPIFactory; 38 using extensions::BrowserContextKeyedAPIFactory;
39 using extensions::HotwordPrivateEventService; 39 using extensions::HotwordPrivateEventService;
40 40
41 namespace { 41 namespace {
42 42
43 // Allowed languages for hotwording. 43 // Allowed languages for hotwording.
44 static const char* kSupportedLocales[] = { 44 static const char* kSupportedLocales[] = {
45 "en", 45 "en",
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 return false; 491 return false;
492 492
493 std::string previous_locale = 493 std::string previous_locale =
494 profile_->GetPrefs()->GetString(prefs::kHotwordPreviousLanguage); 494 profile_->GetPrefs()->GetString(prefs::kHotwordPreviousLanguage);
495 std::string locale = GetCurrentLocale(profile_); 495 std::string locale = GetCurrentLocale(profile_);
496 496
497 // If it's a new locale, then the old extension should be uninstalled. 497 // If it's a new locale, then the old extension should be uninstalled.
498 return locale != previous_locale && 498 return locale != previous_locale &&
499 HotwordService::DoesHotwordSupportLanguage(profile_); 499 HotwordService::DoesHotwordSupportLanguage(profile_);
500 } 500 }
OLDNEW
« no previous file with comments | « chrome/browser/search/contextual_search_promo_source_android.cc ('k') | chrome/browser/search/local_ntp_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698