| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 const std::string& notification_url, | 158 const std::string& notification_url, |
| 159 int title_message_id, | 159 int title_message_id, |
| 160 int body_message_id, | 160 int body_message_id, |
| 161 int button_label_message_id, | 161 int button_label_message_id, |
| 162 const base::Closure& button_click_callback) { | 162 const base::Closure& button_click_callback) { |
| 163 message_center::RichNotificationData optional_field; | 163 message_center::RichNotificationData optional_field; |
| 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, GURL(notification_url), | 168 message_center::NOTIFICATION_TYPE_SIMPLE, |
| 169 l10n_util::GetStringUTF16(title_message_id), | 169 l10n_util::GetStringUTF16(title_message_id), |
| 170 l10n_util::GetStringUTF16(body_message_id), | 170 l10n_util::GetStringUTF16(body_message_id), |
| 171 ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 171 ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 172 IDR_CONSUMER_MANAGEMENT_NOTIFICATION_ICON), | 172 IDR_CONSUMER_MANAGEMENT_NOTIFICATION_ICON), |
| 173 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 173 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
| 174 notification_id), | 174 notification_id), |
| 175 base::string16(), // display_source | 175 base::string16(), // display_source |
| 176 notification_id, optional_field, | 176 GURL(notification_url), notification_id, optional_field, |
| 177 new DesktopNotificationDelegate(notification_id, button_click_callback)); | 177 new DesktopNotificationDelegate(notification_id, button_click_callback)); |
| 178 | 178 |
| 179 notification.SetSystemPriority(); | 179 notification.SetSystemPriority(); |
| 180 g_browser_process->notification_ui_manager()->Add(notification, profile_); | 180 g_browser_process->notification_ui_manager()->Add(notification, profile_); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void ConsumerManagementNotifier::OpenSettingsPage() const { | 183 void ConsumerManagementNotifier::OpenSettingsPage() const { |
| 184 const GURL url(chrome::kChromeUISettingsURL); | 184 const GURL url(chrome::kChromeUISettingsURL); |
| 185 chrome::NavigateParams params(profile_, url, ui::PAGE_TRANSITION_LINK); | 185 chrome::NavigateParams params(profile_, url, ui::PAGE_TRANSITION_LINK); |
| 186 params.disposition = NEW_FOREGROUND_TAB; | 186 params.disposition = NEW_FOREGROUND_TAB; |
| 187 chrome::Navigate(¶ms); | 187 chrome::Navigate(¶ms); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void ConsumerManagementNotifier::TryAgain() const { | 190 void ConsumerManagementNotifier::TryAgain() const { |
| 191 const GURL base_url(chrome::kChromeUISettingsURL); | 191 const GURL base_url(chrome::kChromeUISettingsURL); |
| 192 const GURL url = base_url.Resolve(kConsumerManagementOverlay); | 192 const GURL url = base_url.Resolve(kConsumerManagementOverlay); |
| 193 | 193 |
| 194 chrome::NavigateParams params(profile_, url, ui::PAGE_TRANSITION_LINK); | 194 chrome::NavigateParams params(profile_, url, ui::PAGE_TRANSITION_LINK); |
| 195 params.disposition = NEW_FOREGROUND_TAB; | 195 params.disposition = NEW_FOREGROUND_TAB; |
| 196 chrome::Navigate(¶ms); | 196 chrome::Navigate(¶ms); |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace policy | 199 } // namespace policy |
| OLD | NEW |