OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/chromeos/net/network_portal_notification_controller.h" | 5 #include "chrome/browser/chromeos/net/network_portal_notification_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/system_notifier.h" | 8 #include "ash/system/system_notifier.h" |
9 #include "ash/system/tray/system_tray_notifier.h" | 9 #include "ash/system/tray/system_tray_notifier.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 | 57 |
58 class NetworkPortalNotificationControllerDelegate | 58 class NetworkPortalNotificationControllerDelegate |
59 : public message_center::NotificationDelegate { | 59 : public message_center::NotificationDelegate { |
60 public: | 60 public: |
61 explicit NetworkPortalNotificationControllerDelegate( | 61 explicit NetworkPortalNotificationControllerDelegate( |
62 base::WeakPtr<NetworkPortalNotificationController> controller) | 62 base::WeakPtr<NetworkPortalNotificationController> controller) |
63 : clicked_(false), controller_(controller) {} | 63 : clicked_(false), controller_(controller) {} |
64 | 64 |
65 // Overridden from message_center::NotificationDelegate: | 65 // Overridden from message_center::NotificationDelegate: |
66 virtual void Display() override; | 66 void Display() override; |
67 virtual void Close(bool by_user) override; | 67 void Close(bool by_user) override; |
68 virtual void Click() override; | 68 void Click() override; |
69 | 69 |
70 private: | 70 private: |
71 virtual ~NetworkPortalNotificationControllerDelegate() {} | 71 ~NetworkPortalNotificationControllerDelegate() override {} |
72 | 72 |
73 bool clicked_; | 73 bool clicked_; |
74 | 74 |
75 base::WeakPtr<NetworkPortalNotificationController> controller_; | 75 base::WeakPtr<NetworkPortalNotificationController> controller_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(NetworkPortalNotificationControllerDelegate); | 77 DISALLOW_COPY_AND_ASSIGN(NetworkPortalNotificationControllerDelegate); |
78 }; | 78 }; |
79 | 79 |
80 void NetworkPortalNotificationControllerDelegate::Display() { | 80 void NetworkPortalNotificationControllerDelegate::Display() { |
81 UMA_HISTOGRAM_ENUMERATION( | 81 UMA_HISTOGRAM_ENUMERATION( |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 void NetworkPortalNotificationController::OnDialogDestroyed( | 215 void NetworkPortalNotificationController::OnDialogDestroyed( |
216 const NetworkPortalWebDialog* dialog) { | 216 const NetworkPortalWebDialog* dialog) { |
217 if (dialog == dialog_) { | 217 if (dialog == dialog_) { |
218 dialog_ = nullptr; | 218 dialog_ = nullptr; |
219 ProfileHelper::Get()->ClearSigninProfile(base::Closure()); | 219 ProfileHelper::Get()->ClearSigninProfile(base::Closure()); |
220 } | 220 } |
221 } | 221 } |
222 | 222 |
223 } // namespace chromeos | 223 } // namespace chromeos |
OLD | NEW |