Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: ash/system/tray_locale.h

Issue 10391177: Add TrayLocale for locale change notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698