| 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 "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 return; // Already accepted. | 166 return; // Already accepted. |
| 167 | 167 |
| 168 // Locale change detected, showing notification. | 168 // Locale change detected, showing notification. |
| 169 if (from_locale_ != from_locale || to_locale_ != to_locale) { | 169 if (from_locale_ != from_locale || to_locale_ != to_locale) { |
| 170 // Falling back to showing message in current locale. | 170 // Falling back to showing message in current locale. |
| 171 LOG(ERROR) << | 171 LOG(ERROR) << |
| 172 "Showing locale change notification in current (not previous) language"; | 172 "Showing locale change notification in current (not previous) language"; |
| 173 PrepareChangingLocale(from_locale, to_locale); | 173 PrepareChangingLocale(from_locale, to_locale); |
| 174 } | 174 } |
| 175 | 175 |
| 176 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 176 if (CommandLine::ForCurrentProcess()->HasSwitch(ash::switches::kAshNotify)) { |
| 177 ash::switches::kAshNotifyDisabled)) { | |
| 178 ash::Shell::GetInstance()->system_tray()->locale_observer()-> | 177 ash::Shell::GetInstance()->system_tray()->locale_observer()-> |
| 179 OnLocaleChanged(this, cur_locale, from_locale_, to_locale_); | 178 OnLocaleChanged(this, cur_locale, from_locale_, to_locale_); |
| 180 return; | 179 return; |
| 181 } | 180 } |
| 182 | 181 |
| 183 note_.reset(new chromeos::SystemNotification( | 182 note_.reset(new chromeos::SystemNotification( |
| 184 profile_, | 183 profile_, |
| 185 new Delegate(this), | 184 new Delegate(this), |
| 186 IDR_NOTIFICATION_LOCALE_CHANGE, | 185 IDR_NOTIFICATION_LOCALE_CHANGE, |
| 187 title_text_)); | 186 title_text_)); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 if (by_user) | 243 if (by_user) |
| 245 master_->AcceptLocaleChange(); | 244 master_->AcceptLocaleChange(); |
| 246 } | 245 } |
| 247 | 246 |
| 248 std::string LocaleChangeGuard::Delegate::id() const { | 247 std::string LocaleChangeGuard::Delegate::id() const { |
| 249 // Arbitrary unique Id. | 248 // Arbitrary unique Id. |
| 250 return "8c386938-1e3f-11e0-ac7b-18a90520e2e5"; | 249 return "8c386938-1e3f-11e0-ac7b-18a90520e2e5"; |
| 251 } | 250 } |
| 252 | 251 |
| 253 } // namespace chromeos | 252 } // namespace chromeos |
| OLD | NEW |