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/ui/ash/chrome_screenshot_grabber.h" | 5 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.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 "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 optional_field.buttons.push_back(message_center::ButtonInfo(label)); | 413 optional_field.buttons.push_back(message_center::ButtonInfo(label)); |
414 } | 414 } |
415 return new Notification( | 415 return new Notification( |
416 message_center::NOTIFICATION_TYPE_SIMPLE, GURL(kNotificationOriginUrl), | 416 message_center::NOTIFICATION_TYPE_SIMPLE, GURL(kNotificationOriginUrl), |
417 l10n_util::GetStringUTF16( | 417 l10n_util::GetStringUTF16( |
418 GetScreenshotNotificationTitle(screenshot_result)), | 418 GetScreenshotNotificationTitle(screenshot_result)), |
419 l10n_util::GetStringUTF16( | 419 l10n_util::GetStringUTF16( |
420 GetScreenshotNotificationText(screenshot_result)), | 420 GetScreenshotNotificationText(screenshot_result)), |
421 ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 421 ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
422 IDR_SCREENSHOT_NOTIFICATION_ICON), | 422 IDR_SCREENSHOT_NOTIFICATION_ICON), |
423 blink::WebTextDirectionDefault, | |
424 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 423 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
425 ash::system_notifier::kNotifierScreenshot), | 424 ash::system_notifier::kNotifierScreenshot), |
426 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_NOTIFIER_SCREENSHOT_NAME), | 425 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_NOTIFIER_SCREENSHOT_NAME), |
427 replace_id, optional_field, new ScreenshotGrabberNotificationDelegate( | 426 replace_id, optional_field, new ScreenshotGrabberNotificationDelegate( |
428 success, GetProfile(), screenshot_path)); | 427 success, GetProfile(), screenshot_path)); |
429 } | 428 } |
430 #endif | 429 #endif |
431 | 430 |
432 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) { | 431 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) { |
433 profile_for_test_ = profile; | 432 profile_for_test_ = profile; |
434 } | 433 } |
435 | 434 |
436 Profile* ChromeScreenshotGrabber::GetProfile() { | 435 Profile* ChromeScreenshotGrabber::GetProfile() { |
437 return profile_for_test_ ? profile_for_test_ | 436 return profile_for_test_ ? profile_for_test_ |
438 : ProfileManager::GetActiveUserProfile(); | 437 : ProfileManager::GetActiveUserProfile(); |
439 } | 438 } |
OLD | NEW |