Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: chrome/browser/ui/ash/chrome_screenshot_grabber.cc

Issue 2190773002: Fix Volume slider is captured in screenshot done in touchview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/system/tray/system_tray_notifier.h"
11 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
12 #include "ash/common/wm_shell.h"
10 #include "ash/shell.h" 13 #include "ash/shell.h"
11 #include "base/base64.h" 14 #include "base/base64.h"
12 #include "base/bind.h" 15 #include "base/bind.h"
13 #include "base/callback.h" 16 #include "base/callback.h"
14 #include "base/files/file_util.h" 17 #include "base/files/file_util.h"
15 #include "base/i18n/time_formatting.h" 18 #include "base/i18n/time_formatting.h"
16 #include "base/macros.h" 19 #include "base/macros.h"
17 #include "base/strings/stringprintf.h" 20 #include "base/strings/stringprintf.h"
18 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
19 #include "build/build_config.h" 22 #include "build/build_config.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 NotifierStateTracker* const notifier_state_tracker = 390 NotifierStateTracker* const notifier_state_tracker =
388 NotifierStateTrackerFactory::GetForProfile(GetProfile()); 391 NotifierStateTrackerFactory::GetForProfile(GetProfile());
389 if (notifier_state_tracker->IsNotifierEnabled(message_center::NotifierId( 392 if (notifier_state_tracker->IsNotifierEnabled(message_center::NotifierId(
390 message_center::NotifierId::SYSTEM_COMPONENT, 393 message_center::NotifierId::SYSTEM_COMPONENT,
391 ash::system_notifier::kNotifierScreenshot))) { 394 ash::system_notifier::kNotifierScreenshot))) {
392 std::unique_ptr<Notification> notification( 395 std::unique_ptr<Notification> notification(
393 CreateNotification(result, screenshot_path)); 396 CreateNotification(result, screenshot_path));
394 g_browser_process->notification_ui_manager()->Add(*notification, 397 g_browser_process->notification_ui_manager()->Add(*notification,
395 GetProfile()); 398 GetProfile());
396 } 399 }
400 ash::WmShell* wm_shell = ash::WmShell::Get();
401 if (wm_shell->maximize_mode_controller()
402 ->IsMaximizeModeWindowManagerEnabled())
403 wm_shell->system_tray_notifier()->NotifyDidTakeScreenshot();
397 } 404 }
398 405
399 Notification* ChromeScreenshotGrabber::CreateNotification( 406 Notification* ChromeScreenshotGrabber::CreateNotification(
400 ui::ScreenshotGrabberObserver::Result screenshot_result, 407 ui::ScreenshotGrabberObserver::Result screenshot_result,
401 const base::FilePath& screenshot_path) { 408 const base::FilePath& screenshot_path) {
402 const std::string notification_id(kNotificationId); 409 const std::string notification_id(kNotificationId);
403 // We cancel a previous screenshot notification, if any, to ensure we get 410 // We cancel a previous screenshot notification, if any, to ensure we get
404 // a fresh notification pop-up. 411 // a fresh notification pop-up.
405 g_browser_process->notification_ui_manager()->CancelById( 412 g_browser_process->notification_ui_manager()->CancelById(
406 notification_id, NotificationUIManager::GetProfileID(GetProfile())); 413 notification_id, NotificationUIManager::GetProfileID(GetProfile()));
(...skipping 22 matching lines...) Expand all
429 } 436 }
430 437
431 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) { 438 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) {
432 profile_for_test_ = profile; 439 profile_for_test_ = profile;
433 } 440 }
434 441
435 Profile* ChromeScreenshotGrabber::GetProfile() { 442 Profile* ChromeScreenshotGrabber::GetProfile() {
436 return profile_for_test_ ? profile_for_test_ 443 return profile_for_test_ ? profile_for_test_
437 : ProfileManager::GetActiveUserProfile(); 444 : ProfileManager::GetActiveUserProfile();
438 } 445 }
OLDNEW
« ash/wm/power_button_controller.cc ('K') | « ash/wm/power_button_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698