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

Side by Side Diff: chrome/browser/ui/ash/screenshot_taker.h

Issue 126373002: Make ChromeOS screenshots use async readback path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix rebase error Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chrome/browser/ui/ash/screenshot_taker.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_
6 #define CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ 6 #define CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_
7 7
8 #include "ash/screenshot_delegate.h" 8 #include "ash/screenshot_delegate.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 ScreenshotTakerObserver::Result screenshot_result, 65 ScreenshotTakerObserver::Result screenshot_result,
66 const base::FilePath& screenshot_path); 66 const base::FilePath& screenshot_path);
67 67
68 void AddObserver(ScreenshotTakerObserver* observer); 68 void AddObserver(ScreenshotTakerObserver* observer);
69 void RemoveObserver(ScreenshotTakerObserver* observer); 69 void RemoveObserver(ScreenshotTakerObserver* observer);
70 bool HasObserver(ScreenshotTakerObserver* observer) const; 70 bool HasObserver(ScreenshotTakerObserver* observer) const;
71 71
72 private: 72 private:
73 friend class ash::test::ScreenshotTakerTest; 73 friend class ash::test::ScreenshotTakerTest;
74 74
75 void GrabWindowSnapshotAsyncCallback(
76 base::FilePath screenshot_path,
77 bool is_partial,
78 int window_idx,
79 scoped_refptr<base::RefCountedBytes> png_data);
80 void GrabPartialWindowSnapshotAsync(aura::Window* window,
81 const gfx::Rect& snapshot_bounds,
82 Profile* profile,
83 base::FilePath screenshot_path);
84 void GrabFullWindowSnapshotAsync(aura::Window* window,
85 const gfx::Rect& snapshot_bounds,
86 Profile* profile,
87 base::FilePath screenshot_path,
88 int window_idx);
89
75 Profile* GetProfile(); 90 Profile* GetProfile();
76 void SetScreenshotDirectoryForTest(const base::FilePath& directory); 91 void SetScreenshotDirectoryForTest(const base::FilePath& directory);
77 void SetScreenshotBasenameForTest(const std::string& basename); 92 void SetScreenshotBasenameForTest(const std::string& basename);
78 void SetScreenshotProfileForTest(Profile* profile); 93 void SetScreenshotProfileForTest(Profile* profile);
79 94
80 Notification* CreateNotification( 95 Notification* CreateNotification(
81 ScreenshotTakerObserver::Result screenshot_result, 96 ScreenshotTakerObserver::Result screenshot_result,
82 const base::FilePath& screenshot_path); 97 const base::FilePath& screenshot_path);
83 98
84 base::WeakPtrFactory<ScreenshotTaker> factory_; 99 base::WeakPtrFactory<ScreenshotTaker> factory_;
85 100
86 // The timestamp when the screenshot task was issued last time. 101 // The timestamp when the screenshot task was issued last time.
87 base::Time last_screenshot_timestamp_; 102 base::Time last_screenshot_timestamp_;
88 103
89 ObserverList<ScreenshotTakerObserver> observers_; 104 ObserverList<ScreenshotTakerObserver> observers_;
90 105
91 base::FilePath screenshot_directory_for_test_; 106 base::FilePath screenshot_directory_for_test_;
92 std::string screenshot_basename_for_test_; 107 std::string screenshot_basename_for_test_;
93 Profile* profile_for_test_; 108 Profile* profile_for_test_;
94 109
95 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker); 110 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker);
96 }; 111 };
97 112
98 #endif // CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ 113 #endif // CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chrome/browser/ui/ash/screenshot_taker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698