OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "win8/metro_driver/stdafx.h" | 7 #include "win8/metro_driver/stdafx.h" |
8 #include "win8/metro_driver/toast_notification_handler.h" | 8 #include "win8/metro_driver/toast_notification_handler.h" |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 toast_notification_factory; | 189 toast_notification_factory; |
190 hr = winrt_utils::CreateActivationFactory( | 190 hr = winrt_utils::CreateActivationFactory( |
191 RuntimeClass_Windows_UI_Notifications_ToastNotification, | 191 RuntimeClass_Windows_UI_Notifications_ToastNotification, |
192 toast_notification_factory.GetAddressOf()); | 192 toast_notification_factory.GetAddressOf()); |
193 CheckHR(hr); | 193 CheckHR(hr); |
194 | 194 |
195 hr = toast_notification_factory->CreateToastNotification( | 195 hr = toast_notification_factory->CreateToastNotification( |
196 toast_xml.Get(), ¬ification_); | 196 toast_xml.Get(), ¬ification_); |
197 CheckHR(hr); | 197 CheckHR(hr); |
198 | 198 |
199 FilePath chrome_path; | 199 base::FilePath chrome_path; |
200 if (!PathService::Get(base::FILE_EXE, &chrome_path)) { | 200 if (!PathService::Get(base::FILE_EXE, &chrome_path)) { |
201 NOTREACHED() << "Failed to get chrome exe path"; | 201 NOTREACHED() << "Failed to get chrome exe path"; |
202 return; | 202 return; |
203 } | 203 } |
204 string16 appid = delegate_execute::GetAppId(chrome_path); | 204 string16 appid = delegate_execute::GetAppId(chrome_path); |
205 DVLOG(1) << "Chrome Appid is " << appid.c_str(); | 205 DVLOG(1) << "Chrome Appid is " << appid.c_str(); |
206 | 206 |
207 // TODO(ananta) | 207 // TODO(ananta) |
208 // We should probably use BrowserDistribution here to get the product name. | 208 // We should probably use BrowserDistribution here to get the product name. |
209 mswrw::HString app_user_model_id; | 209 mswrw::HString app_user_model_id; |
(...skipping 30 matching lines...) Expand all Loading... |
240 // etc to ChromeAppView which would enable it to ensure that the | 240 // etc to ChromeAppView which would enable it to ensure that the |
241 // correct tab in chrome is activated. | 241 // correct tab in chrome is activated. |
242 DVLOG(1) << __FUNCTION__; | 242 DVLOG(1) << __FUNCTION__; |
243 | 243 |
244 if (notification_info_.notification_handler) { | 244 if (notification_info_.notification_handler) { |
245 notification_info_.notification_handler( | 245 notification_info_.notification_handler( |
246 notification_info_.notification_context.c_str()); | 246 notification_info_.notification_context.c_str()); |
247 } | 247 } |
248 return S_OK; | 248 return S_OK; |
249 } | 249 } |
OLD | NEW |