| 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/chromeos/locale_change_guard.h" | 5 #include "chrome/browser/chromeos/locale_change_guard.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 void LocaleChangeGuard::ConnectToLocaleNotificationController() { | 66 void LocaleChangeGuard::ConnectToLocaleNotificationController() { |
| 67 content::ServiceManagerConnection* connection = | 67 content::ServiceManagerConnection* connection = |
| 68 content::ServiceManagerConnection::GetForProcess(); | 68 content::ServiceManagerConnection::GetForProcess(); |
| 69 service_manager::Connector* connector = | 69 service_manager::Connector* connector = |
| 70 connection ? connection->GetConnector() : nullptr; | 70 connection ? connection->GetConnector() : nullptr; |
| 71 // Unit tests may not have a connector. | 71 // Unit tests may not have a connector. |
| 72 if (!connector) | 72 if (!connector) |
| 73 return; | 73 return; |
| 74 | 74 |
| 75 connector->ConnectToInterface(ash_util::GetAshServiceName(), | 75 connector->BindInterface(ash_util::GetAshServiceName(), |
| 76 ¬ification_controller_); | 76 ¬ification_controller_); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void LocaleChangeGuard::RevertLocaleChange() { | 79 void LocaleChangeGuard::RevertLocaleChange() { |
| 80 if (profile_ == NULL || | 80 if (profile_ == NULL || |
| 81 from_locale_.empty() || | 81 from_locale_.empty() || |
| 82 to_locale_.empty()) { | 82 to_locale_.empty()) { |
| 83 NOTREACHED(); | 83 NOTREACHED(); |
| 84 return; | 84 return; |
| 85 } | 85 } |
| 86 if (reverted_) | 86 if (reverted_) |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 LocaleChangeGuard::GetSkipShowNotificationLanguagesForTesting() { | 266 LocaleChangeGuard::GetSkipShowNotificationLanguagesForTesting() { |
| 267 return kSkipShowNotificationLanguages; | 267 return kSkipShowNotificationLanguages; |
| 268 } | 268 } |
| 269 | 269 |
| 270 // static | 270 // static |
| 271 size_t LocaleChangeGuard::GetSkipShowNotificationLanguagesSizeForTesting() { | 271 size_t LocaleChangeGuard::GetSkipShowNotificationLanguagesSizeForTesting() { |
| 272 return arraysize(kSkipShowNotificationLanguages); | 272 return arraysize(kSkipShowNotificationLanguages); |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace chromeos | 275 } // namespace chromeos |
| OLD | NEW |