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

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

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified CL to provide TrayItems and Tray*Views with parent pointers instead. Created 8 years, 1 month 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
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 #ifndef ASH_SYSTEM_LOCALE_TRAY_LOCALE_H_ 5 #ifndef ASH_SYSTEM_LOCALE_TRAY_LOCALE_H_
6 #define ASH_SYSTEM_LOCALE_TRAY_LOCALE_H_ 6 #define ASH_SYSTEM_LOCALE_TRAY_LOCALE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ash/system/locale/locale_observer.h" 10 #include "ash/system/locale/locale_observer.h"
11 #include "ash/system/tray/system_tray_item.h" 11 #include "ash/system/tray/system_tray_item.h"
12 12
13 namespace ash { 13 namespace ash {
14
15 class SystemTray;
16
14 namespace internal { 17 namespace internal {
15 18
16 namespace tray { 19 namespace tray {
17 class LocaleNotificationView; 20 class LocaleNotificationView;
18 } 21 }
19 22
20 class TrayLocale : public SystemTrayItem, 23 class TrayLocale : public SystemTrayItem,
21 public LocaleObserver { 24 public LocaleObserver {
22 public: 25 public:
23 TrayLocale(); 26 explicit TrayLocale(SystemTray* system_tray);
24 virtual ~TrayLocale(); 27 virtual ~TrayLocale();
25 28
26 private: 29 private:
27 // Overridden from TrayImageItem. 30 // Overridden from TrayImageItem.
28 virtual views::View* CreateNotificationView( 31 virtual views::View* CreateNotificationView(
29 user::LoginStatus status) OVERRIDE; 32 user::LoginStatus status) OVERRIDE;
30 virtual void DestroyNotificationView() OVERRIDE; 33 virtual void DestroyNotificationView() OVERRIDE;
31 34
32 // Overridden from LocaleObserver. 35 // Overridden from LocaleObserver.
33 virtual void OnLocaleChanged(LocaleObserver::Delegate* delegate, 36 virtual void OnLocaleChanged(LocaleObserver::Delegate* delegate,
34 const std::string& cur_locale, 37 const std::string& cur_locale,
35 const std::string& from_locale, 38 const std::string& from_locale,
36 const std::string& to_locale) OVERRIDE; 39 const std::string& to_locale) OVERRIDE;
37 40
38 tray::LocaleNotificationView* notification_; 41 tray::LocaleNotificationView* notification_;
39 LocaleObserver::Delegate* delegate_; 42 LocaleObserver::Delegate* delegate_;
40 std::string cur_locale_; 43 std::string cur_locale_;
41 std::string from_locale_; 44 std::string from_locale_;
42 std::string to_locale_; 45 std::string to_locale_;
43 46
44 DISALLOW_COPY_AND_ASSIGN(TrayLocale); 47 DISALLOW_COPY_AND_ASSIGN(TrayLocale);
45 }; 48 };
46 49
47 } // namespace internal 50 } // namespace internal
48 } // namespace ash 51 } // namespace ash
49 52
50 #endif // ASH_SYSTEM_LOCALE_TRAY_LOCALE_H_ 53 #endif // ASH_SYSTEM_LOCALE_TRAY_LOCALE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698