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

Side by Side Diff: ash/utility/screenshot_controller_unittest.cc

Issue 2291913002: Allow the user to cancel the capture region action, and show its active status in the tray. (Closed)
Patch Set: Address comments Created 4 years, 3 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
« no previous file with comments | « ash/utility/screenshot_controller.cc ('k') | chrome/browser/ui/ash/palette_delegate_chromeos.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/utility/screenshot_controller.h" 5 #include "ash/utility/screenshot_controller.h"
6 6
7 #include "ash/display/cursor_window_controller.h" 7 #include "ash/display/cursor_window_controller.h"
8 #include "ash/display/mouse_cursor_event_filter.h" 8 #include "ash/display/mouse_cursor_event_filter.h"
9 #include "ash/display/window_tree_host_manager.h" 9 #include "ash/display/window_tree_host_manager.h"
10 #include "ash/screenshot_delegate.h" 10 #include "ash/screenshot_delegate.h"
(...skipping 29 matching lines...) Expand all
40 void StartPartialScreenshotSession() { 40 void StartPartialScreenshotSession() {
41 screenshot_controller()->StartPartialScreenshotSession( 41 screenshot_controller()->StartPartialScreenshotSession(
42 GetScreenshotDelegate(), true); 42 GetScreenshotDelegate(), true);
43 } 43 }
44 44
45 void StartWindowScreenshotSession() { 45 void StartWindowScreenshotSession() {
46 screenshot_controller()->StartWindowScreenshotSession( 46 screenshot_controller()->StartWindowScreenshotSession(
47 GetScreenshotDelegate()); 47 GetScreenshotDelegate());
48 } 48 }
49 49
50 void Cancel() { screenshot_controller()->Cancel(); } 50 void Cancel() { screenshot_controller()->CancelScreenshotSession(); }
51 51
52 bool IsActive() { 52 bool IsActive() {
53 return screenshot_controller()->screenshot_delegate_ != nullptr; 53 return screenshot_controller()->screenshot_delegate_ != nullptr;
54 } 54 }
55 55
56 const gfx::Point& GetStartPosition() const { 56 const gfx::Point& GetStartPosition() const {
57 return Shell::GetInstance()->screenshot_controller()->start_position_; 57 return Shell::GetInstance()->screenshot_controller()->start_position_;
58 } 58 }
59 59
60 const aura::Window* GetCurrentSelectedWindow() const { 60 const aura::Window* GetCurrentSelectedWindow() const {
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 EXPECT_FALSE(IsActive()); 475 EXPECT_FALSE(IsActive());
476 476
477 StartWindowScreenshotSession(); 477 StartWindowScreenshotSession();
478 EXPECT_TRUE(IsActive()); 478 EXPECT_TRUE(IsActive());
479 UpdateDisplay("400x400"); 479 UpdateDisplay("400x400");
480 RunAllPendingInMessageLoop(); 480 RunAllPendingInMessageLoop();
481 EXPECT_FALSE(IsActive()); 481 EXPECT_FALSE(IsActive());
482 } 482 }
483 483
484 } // namespace ash 484 } // namespace ash
OLDNEW
« no previous file with comments | « ash/utility/screenshot_controller.cc ('k') | chrome/browser/ui/ash/palette_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698