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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "ash/common/strings/grit/ash_strings.h" | 9 #include "ash/common/strings/grit/ash_strings.h" |
10 #include "ash/common/system/system_notifier.h" | 10 #include "ash/common/system/system_notifier.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 } | 391 } |
392 ui::ScreenshotGrabberDelegate::PrepareFileAndRunOnBlockingPool( | 392 ui::ScreenshotGrabberDelegate::PrepareFileAndRunOnBlockingPool( |
393 path, blocking_task_runner, callback); | 393 path, blocking_task_runner, callback); |
394 } | 394 } |
395 | 395 |
396 void ChromeScreenshotGrabber::OnScreenshotCompleted( | 396 void ChromeScreenshotGrabber::OnScreenshotCompleted( |
397 ui::ScreenshotGrabberObserver::Result result, | 397 ui::ScreenshotGrabberObserver::Result result, |
398 const base::FilePath& screenshot_path) { | 398 const base::FilePath& screenshot_path) { |
399 // Do not show a notification that a screenshot was taken while no user is | 399 // Do not show a notification that a screenshot was taken while no user is |
400 // logged in, since it is confusing for the user to get a message about it | 400 // logged in, since it is confusing for the user to get a message about it |
401 // after he logs in (crbug.com/235217). | 401 // after they log in (crbug.com/235217). |
402 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) | 402 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) |
403 return; | 403 return; |
404 | 404 |
405 // TODO(sschmitz): make this work for Windows. | 405 // TODO(sschmitz): make this work for Windows. |
406 NotifierStateTracker* const notifier_state_tracker = | 406 NotifierStateTracker* const notifier_state_tracker = |
407 NotifierStateTrackerFactory::GetForProfile(GetProfile()); | 407 NotifierStateTrackerFactory::GetForProfile(GetProfile()); |
408 if (notifier_state_tracker->IsNotifierEnabled(message_center::NotifierId( | 408 if (notifier_state_tracker->IsNotifierEnabled(message_center::NotifierId( |
409 message_center::NotifierId::SYSTEM_COMPONENT, | 409 message_center::NotifierId::SYSTEM_COMPONENT, |
410 ash::system_notifier::kNotifierScreenshot))) { | 410 ash::system_notifier::kNotifierScreenshot))) { |
411 std::unique_ptr<Notification> notification( | 411 std::unique_ptr<Notification> notification( |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 } | 464 } |
465 | 465 |
466 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) { | 466 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) { |
467 profile_for_test_ = profile; | 467 profile_for_test_ = profile; |
468 } | 468 } |
469 | 469 |
470 Profile* ChromeScreenshotGrabber::GetProfile() { | 470 Profile* ChromeScreenshotGrabber::GetProfile() { |
471 return profile_for_test_ ? profile_for_test_ | 471 return profile_for_test_ ? profile_for_test_ |
472 : ProfileManager::GetActiveUserProfile(); | 472 : ProfileManager::GetActiveUserProfile(); |
473 } | 473 } |
OLD | NEW |