Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/lazy_instance.h" | |
| 10 #include "base/scoped_ptr.h" | |
| 11 #include "chrome/browser/chromeos/notifications/system_notification.h" | |
| 12 #include "chrome/browser/notifications/notification_delegate.h" | |
| 13 #include "chrome/browser/profiles/profile.h" | |
| 14 | |
| 15 class ListValue; | |
| 16 class TabContents; | |
| 17 | |
| 18 namespace chromeos { | |
| 19 | |
| 20 class LocaleChangeGuard { | |
|
oshima
2011/01/12 21:11:53
description of the class would be nice.
Denis Lagno
2011/01/13 10:46:44
Done.
| |
| 21 public: | |
| 22 static void Check(TabContents* tab_contents); | |
| 23 | |
| 24 private: | |
| 25 class Delegate : public NotificationDelegate { | |
| 26 public: | |
| 27 explicit Delegate(chromeos::LocaleChangeGuard* master) : master_(master) {} | |
| 28 void Close(bool by_user); | |
| 29 void Display() {} | |
| 30 void Error() {} | |
| 31 void Click() {} | |
| 32 std::string id() const; | |
| 33 | |
| 34 private: | |
| 35 chromeos::LocaleChangeGuard* master_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(Delegate); | |
| 38 }; | |
| 39 | |
| 40 LocaleChangeGuard(); | |
| 41 void CheckLocaleChange(TabContents* tab_contents); | |
| 42 void RevertLocaleChange(const ListValue* list); | |
| 43 void AcceptLocaleChange(); | |
| 44 | |
| 45 std::string from_locale_; | |
| 46 std::string to_locale_; | |
| 47 ProfileId profile_id_; | |
| 48 TabContents* tab_contents_; | |
| 49 scoped_ptr<chromeos::SystemNotification> note_; | |
| 50 bool reverted_; | |
| 51 | |
| 52 friend struct base::DefaultLazyInstanceTraits<LocaleChangeGuard>; | |
| 53 }; | |
| 54 | |
| 55 } // namespace chromeos | |
| 56 | |
| 57 #endif // CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ | |
| OLD | NEW |