OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_SYSTEM_TRAY_LOCALE_H_ | |
6 #define ASH_SYSTEM_TRAY_LOCALE_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "ash/system/tray/tray_image_item.h" | |
12 | |
13 namespace ash { | |
14 | |
15 class ASH_EXPORT LocaleChangeDelegate { | |
sadrul
2012/05/17 03:15:44
LocaleChangeDelegate and LocaleObserver could move
stevenjb
2012/05/17 16:58:57
Fair point.
Created a locale/ subdirectory
Moved
| |
16 public: | |
17 virtual ~LocaleChangeDelegate() {} | |
18 | |
19 virtual void AcceptLocaleChange() = 0; | |
20 virtual void RevertLocaleChange() = 0; | |
21 }; | |
22 | |
23 class ASH_EXPORT LocaleObserver { | |
24 public: | |
25 virtual ~LocaleObserver() {} | |
26 | |
27 virtual void OnLocaleChanged(LocaleChangeDelegate* delegate, | |
28 const std::string& cur_locale, | |
29 const std::string& from_locale, | |
30 const std::string& to_locale) = 0; | |
31 }; | |
32 | |
33 namespace internal { | |
34 | |
35 namespace tray { | |
36 class LocaleNotificationView; | |
37 } | |
38 | |
39 class TrayLocale : public TrayImageItem, | |
40 public LocaleObserver { | |
41 public: | |
42 TrayLocale(); | |
43 virtual ~TrayLocale(); | |
44 | |
45 private: | |
46 // Overridden from TrayImageItem. | |
47 virtual bool GetInitialVisibility() OVERRIDE; | |
48 virtual views::View* CreateNotificationView( | |
49 user::LoginStatus status) OVERRIDE; | |
50 virtual void DestroyNotificationView() OVERRIDE; | |
51 | |
52 // Overridden from LocaleObserver. | |
53 virtual void OnLocaleChanged(LocaleChangeDelegate* delegate, | |
54 const std::string& cur_locale, | |
55 const std::string& from_locale, | |
56 const std::string& to_locale) OVERRIDE; | |
57 | |
58 tray::LocaleNotificationView* notification_; | |
59 LocaleChangeDelegate* delegate_; | |
60 std::string cur_locale_; | |
61 std::string from_locale_; | |
62 std::string to_locale_; | |
63 | |
64 DISALLOW_COPY_AND_ASSIGN(TrayLocale); | |
65 }; | |
66 | |
67 } // namespace internal | |
68 } // namespace ash | |
69 | |
70 #endif // ASH_SYSTEM_TRAY_LOCALE_H_ | |
OLD | NEW |