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

Unified Diff: ash/system/chromeos/network/tray_vpn.cc

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 side-by-side diff with in-line comments
Download patch
Index: ash/system/chromeos/network/tray_vpn.cc
diff --git a/ash/system/chromeos/network/tray_vpn.cc b/ash/system/chromeos/network/tray_vpn.cc
index 674e1af670b68301858ef46039e2318cefaac50e..b5dc6ece182700f7f94032dc44e0a8cafeff6c92 100644
--- a/ash/system/chromeos/network/tray_vpn.cc
+++ b/ash/system/chromeos/network/tray_vpn.cc
@@ -6,6 +6,7 @@
#include "ash/shell.h"
#include "ash/system/chromeos/network/network_list_detailed_view_base.h"
+#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_item_more.h"
@@ -19,8 +20,8 @@ namespace tray {
class VpnDefaultView : public TrayItemMore {
public:
- VpnDefaultView(SystemTrayItem* owner, bool show_more)
- : TrayItemMore(owner, show_more) {
+ VpnDefaultView(SystemTrayItem* tray, bool show_more)
+ : TrayItemMore(tray, show_more) {
Update();
}
@@ -40,8 +41,10 @@ class VpnDefaultView : public TrayItemMore {
class VpnListDetailedView : public NetworkListDetailedViewBase {
public:
- VpnListDetailedView(user::LoginStatus login, int header_string_id)
- : NetworkListDetailedViewBase(login, header_string_id),
+ VpnListDetailedView(SystemTrayItem* tray,
+ user::LoginStatus login,
+ int header_string_id)
+ : NetworkListDetailedViewBase(tray, login, header_string_id),
other_vpn_(NULL) {
}
virtual ~VpnListDetailedView() {
@@ -116,8 +119,9 @@ class VpnListDetailedView : public NetworkListDetailedViewBase {
} // namespace tray
-TrayVPN::TrayVPN()
- : default_(NULL),
+TrayVPN::TrayVPN(SystemTray* system_tray)
+ : SystemTrayItem(system_tray),
+ default_(NULL),
detailed_(NULL) {
}
@@ -145,7 +149,8 @@ views::View* TrayVPN::CreateDefaultView(user::LoginStatus status) {
views::View* TrayVPN::CreateDetailedView(user::LoginStatus status) {
CHECK(detailed_ == NULL);
- detailed_ = new tray::VpnListDetailedView(status, IDS_ASH_STATUS_TRAY_VPN);
+ detailed_ = new tray::VpnListDetailedView(
+ this, status, IDS_ASH_STATUS_TRAY_VPN);
detailed_->Init();
return detailed_;
}

Powered by Google App Engine
This is Rietveld 408576698