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/policy/consumer_management_service.h" | 5 #include "chrome/browser/chromeos/policy/consumer_management_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 class DesktopNotificationDelegate : public NotificationDelegate { | 75 class DesktopNotificationDelegate : public NotificationDelegate { |
76 public: | 76 public: |
77 // |button_click_callback| is called when the button in the notification is | 77 // |button_click_callback| is called when the button in the notification is |
78 // clicked. | 78 // clicked. |
79 DesktopNotificationDelegate(const std::string& id, | 79 DesktopNotificationDelegate(const std::string& id, |
80 const base::Closure& button_click_callback); | 80 const base::Closure& button_click_callback); |
81 | 81 |
82 // NotificationDelegate: | 82 // NotificationDelegate: |
83 virtual std::string id() const OVERRIDE; | 83 virtual std::string id() const OVERRIDE; |
84 virtual content::WebContents* GetWebContents() const OVERRIDE; | |
85 virtual void Display() OVERRIDE; | 84 virtual void Display() OVERRIDE; |
86 virtual void ButtonClick(int button_index) OVERRIDE; | 85 virtual void ButtonClick(int button_index) OVERRIDE; |
87 virtual void Error() OVERRIDE; | 86 virtual void Error() OVERRIDE; |
88 virtual void Close(bool by_user) OVERRIDE; | 87 virtual void Close(bool by_user) OVERRIDE; |
89 virtual void Click() OVERRIDE; | 88 virtual void Click() OVERRIDE; |
90 | 89 |
91 private: | 90 private: |
92 virtual ~DesktopNotificationDelegate(); | 91 virtual ~DesktopNotificationDelegate(); |
93 | 92 |
94 std::string id_; | 93 std::string id_; |
95 base::Closure button_click_callback_; | 94 base::Closure button_click_callback_; |
96 | 95 |
97 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationDelegate); | 96 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationDelegate); |
98 }; | 97 }; |
99 | 98 |
100 DesktopNotificationDelegate::DesktopNotificationDelegate( | 99 DesktopNotificationDelegate::DesktopNotificationDelegate( |
101 const std::string& id, | 100 const std::string& id, |
102 const base::Closure& button_click_callback) | 101 const base::Closure& button_click_callback) |
103 : id_(id), button_click_callback_(button_click_callback) { | 102 : id_(id), button_click_callback_(button_click_callback) { |
104 } | 103 } |
105 | 104 |
106 DesktopNotificationDelegate::~DesktopNotificationDelegate() { | 105 DesktopNotificationDelegate::~DesktopNotificationDelegate() { |
107 } | 106 } |
108 | 107 |
109 std::string DesktopNotificationDelegate::id() const { | 108 std::string DesktopNotificationDelegate::id() const { |
110 return id_; | 109 return id_; |
111 } | 110 } |
112 | 111 |
113 content::WebContents* DesktopNotificationDelegate::GetWebContents() const { | |
114 return NULL; | |
115 } | |
116 | |
117 void DesktopNotificationDelegate::Display() { | 112 void DesktopNotificationDelegate::Display() { |
118 } | 113 } |
119 | 114 |
120 void DesktopNotificationDelegate::ButtonClick(int button_index) { | 115 void DesktopNotificationDelegate::ButtonClick(int button_index) { |
121 button_click_callback_.Run(); | 116 button_click_callback_.Run(); |
122 } | 117 } |
123 | 118 |
124 void DesktopNotificationDelegate::Error() { | 119 void DesktopNotificationDelegate::Error() { |
125 } | 120 } |
126 | 121 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 chrome::NavigateParams params(profile, url, ui::PAGE_TRANSITION_LINK); | 521 chrome::NavigateParams params(profile, url, ui::PAGE_TRANSITION_LINK); |
527 params.disposition = NEW_FOREGROUND_TAB; | 522 params.disposition = NEW_FOREGROUND_TAB; |
528 chrome::Navigate(¶ms); | 523 chrome::Navigate(¶ms); |
529 } | 524 } |
530 | 525 |
531 void ConsumerManagementService::NotifyStatusChanged() { | 526 void ConsumerManagementService::NotifyStatusChanged() { |
532 FOR_EACH_OBSERVER(Observer, observers_, OnConsumerManagementStatusChanged()); | 527 FOR_EACH_OBSERVER(Observer, observers_, OnConsumerManagementStatusChanged()); |
533 } | 528 } |
534 | 529 |
535 } // namespace policy | 530 } // namespace policy |
OLD | NEW |