| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chromeos/notifications/system_notification.h" | 10 #include "chrome/browser/chromeos/notifications/system_notification.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 void Click() {} | 36 void Click() {} |
| 37 std::string id() const; | 37 std::string id() const; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 chromeos::LocaleChangeGuard* master_; | 40 chromeos::LocaleChangeGuard* master_; |
| 41 | 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(Delegate); | 42 DISALLOW_COPY_AND_ASSIGN(Delegate); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 LocaleChangeGuard::LocaleChangeGuard() | 45 LocaleChangeGuard::LocaleChangeGuard() |
| 46 : profile_id_(Profile::InvalidProfileId), | 46 : profile_id_(Profile::kInvalidProfileId), |
| 47 tab_contents_(NULL), | 47 tab_contents_(NULL), |
| 48 note_(NULL), | 48 note_(NULL), |
| 49 reverted_(false) { | 49 reverted_(false) { |
| 50 } | 50 } |
| 51 | 51 |
| 52 void LocaleChangeGuard::RevertLocaleChange(const ListValue* list) { | 52 void LocaleChangeGuard::RevertLocaleChange(const ListValue* list) { |
| 53 if (note_ == NULL || | 53 if (note_ == NULL || |
| 54 tab_contents_ == NULL || | 54 tab_contents_ == NULL || |
| 55 from_locale_.empty() || | 55 from_locale_.empty() || |
| 56 to_locale_.empty()) { | 56 to_locale_.empty()) { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 if (by_user) | 169 if (by_user) |
| 170 master_->AcceptLocaleChange(); | 170 master_->AcceptLocaleChange(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 std::string LocaleChangeGuard::Delegate::id() const { | 173 std::string LocaleChangeGuard::Delegate::id() const { |
| 174 // Arbitrary unique Id. | 174 // Arbitrary unique Id. |
| 175 return "8c386938-1e3f-11e0-ac7b-18a90520e2e5"; | 175 return "8c386938-1e3f-11e0-ac7b-18a90520e2e5"; |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace chromeos | 178 } // namespace chromeos |
| OLD | NEW |