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_notifier.h" | 5 #include "chrome/browser/chromeos/policy/consumer_management_notifier.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 optional_field.buttons.push_back(message_center::ButtonInfo( | 164 optional_field.buttons.push_back(message_center::ButtonInfo( |
165 l10n_util::GetStringUTF16(button_label_message_id))); | 165 l10n_util::GetStringUTF16(button_label_message_id))); |
166 | 166 |
167 Notification notification( | 167 Notification notification( |
168 message_center::NOTIFICATION_TYPE_SIMPLE, | 168 message_center::NOTIFICATION_TYPE_SIMPLE, |
169 GURL(notification_url), | 169 GURL(notification_url), |
170 l10n_util::GetStringUTF16(title_message_id), | 170 l10n_util::GetStringUTF16(title_message_id), |
171 l10n_util::GetStringUTF16(body_message_id), | 171 l10n_util::GetStringUTF16(body_message_id), |
172 ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 172 ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
173 IDR_CONSUMER_MANAGEMENT_NOTIFICATION_ICON), | 173 IDR_CONSUMER_MANAGEMENT_NOTIFICATION_ICON), |
174 blink::WebTextDirectionDefault, | |
175 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 174 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
176 notification_id), | 175 notification_id), |
177 base::string16(), // display_source | 176 base::string16(), // display_source |
178 base::UTF8ToUTF16(notification_id), | 177 base::UTF8ToUTF16(notification_id), |
179 optional_field, | 178 optional_field, |
180 new DesktopNotificationDelegate(notification_id, button_click_callback)); | 179 new DesktopNotificationDelegate(notification_id, button_click_callback)); |
181 | 180 |
182 notification.SetSystemPriority(); | 181 notification.SetSystemPriority(); |
183 g_browser_process->notification_ui_manager()->Add(notification, profile_); | 182 g_browser_process->notification_ui_manager()->Add(notification, profile_); |
184 } | 183 } |
185 | 184 |
186 void ConsumerManagementNotifier::OpenSettingsPage() const { | 185 void ConsumerManagementNotifier::OpenSettingsPage() const { |
187 const GURL url(chrome::kChromeUISettingsURL); | 186 const GURL url(chrome::kChromeUISettingsURL); |
188 chrome::NavigateParams params(profile_, url, ui::PAGE_TRANSITION_LINK); | 187 chrome::NavigateParams params(profile_, url, ui::PAGE_TRANSITION_LINK); |
189 params.disposition = NEW_FOREGROUND_TAB; | 188 params.disposition = NEW_FOREGROUND_TAB; |
190 chrome::Navigate(¶ms); | 189 chrome::Navigate(¶ms); |
191 } | 190 } |
192 | 191 |
193 void ConsumerManagementNotifier::TryAgain() const { | 192 void ConsumerManagementNotifier::TryAgain() const { |
194 const GURL base_url(chrome::kChromeUISettingsURL); | 193 const GURL base_url(chrome::kChromeUISettingsURL); |
195 const GURL url = base_url.Resolve(kConsumerManagementOverlay); | 194 const GURL url = base_url.Resolve(kConsumerManagementOverlay); |
196 | 195 |
197 chrome::NavigateParams params(profile_, url, ui::PAGE_TRANSITION_LINK); | 196 chrome::NavigateParams params(profile_, url, ui::PAGE_TRANSITION_LINK); |
198 params.disposition = NEW_FOREGROUND_TAB; | 197 params.disposition = NEW_FOREGROUND_TAB; |
199 chrome::Navigate(¶ms); | 198 chrome::Navigate(¶ms); |
200 } | 199 } |
201 | 200 |
202 } // namespace policy | 201 } // namespace policy |
OLD | NEW |