Chromium Code Reviews| 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/system/system_notifier.h" | 9 #include "ash/common/system/system_notifier.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 base::Bind(&EnsureDirectoryExistsCallback, callback, profile, path)); | 370 base::Bind(&EnsureDirectoryExistsCallback, callback, profile, path)); |
| 371 return; | 371 return; |
| 372 } | 372 } |
| 373 ui::ScreenshotGrabberDelegate::PrepareFileAndRunOnBlockingPool( | 373 ui::ScreenshotGrabberDelegate::PrepareFileAndRunOnBlockingPool( |
| 374 path, blocking_task_runner, callback); | 374 path, blocking_task_runner, callback); |
| 375 } | 375 } |
| 376 | 376 |
| 377 void ChromeScreenshotGrabber::OnScreenshotCompleted( | 377 void ChromeScreenshotGrabber::OnScreenshotCompleted( |
| 378 ui::ScreenshotGrabberObserver::Result result, | 378 ui::ScreenshotGrabberObserver::Result result, |
| 379 const base::FilePath& screenshot_path) { | 379 const base::FilePath& screenshot_path) { |
| 380 // Cursor is hidden during the screenshot. Show it when screenshot completed. | |
| 381 ash::Shell* shell = ash::Shell::GetInstance(); | |
| 382 if (shell->cursor_manager()) | |
| 383 shell->cursor_manager()->ShowCursor(); | |
|
sky
2016/07/21 19:40:26
Why is the show here and not in ScreenshotGrabber?
Qiang(Joe) Xu
2016/07/21 23:02:49
Thanks, based on the suggestion I got a updated ve
| |
| 380 // Do not show a notification that a screenshot was taken while no user is | 384 // Do not show a notification that a screenshot was taken while no user is |
| 381 // logged in, since it is confusing for the user to get a message about it | 385 // logged in, since it is confusing for the user to get a message about it |
| 382 // after he logs in (crbug.com/235217). | 386 // after he logs in (crbug.com/235217). |
| 383 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) | 387 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) |
| 384 return; | 388 return; |
| 385 | 389 |
| 386 // TODO(sschmitz): make this work for Windows. | 390 // TODO(sschmitz): make this work for Windows. |
| 387 NotifierStateTracker* const notifier_state_tracker = | 391 NotifierStateTracker* const notifier_state_tracker = |
| 388 NotifierStateTrackerFactory::GetForProfile(GetProfile()); | 392 NotifierStateTrackerFactory::GetForProfile(GetProfile()); |
| 389 if (notifier_state_tracker->IsNotifierEnabled(message_center::NotifierId( | 393 if (notifier_state_tracker->IsNotifierEnabled(message_center::NotifierId( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 429 } | 433 } |
| 430 | 434 |
| 431 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) { | 435 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) { |
| 432 profile_for_test_ = profile; | 436 profile_for_test_ = profile; |
| 433 } | 437 } |
| 434 | 438 |
| 435 Profile* ChromeScreenshotGrabber::GetProfile() { | 439 Profile* ChromeScreenshotGrabber::GetProfile() { |
| 436 return profile_for_test_ ? profile_for_test_ | 440 return profile_for_test_ ? profile_for_test_ |
| 437 : ProfileManager::GetActiveUserProfile(); | 441 : ProfileManager::GetActiveUserProfile(); |
| 438 } | 442 } |
| OLD | NEW |