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

Unified Diff: chrome/browser/policy/policy_browsertest.cc

Issue 706013004: Move non-browser specific ScreenshotTaker code to ui/snapshot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge and fix gn Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/ash/ash_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 5e9dd5e9933cefeacb47c9ee523deb723945eced..3646936b3fddeb93d5bf8b4b5339e151f48b4293 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -164,10 +164,11 @@
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/ash/screenshot_taker.h"
+#include "chrome/browser/ui/ash/chrome_screenshot_grabber.h"
#include "chromeos/audio/cras_audio_handler.h"
#include "ui/chromeos/accessibility_types.h"
#include "ui/keyboard/keyboard_util.h"
+#include "ui/snapshot/screenshot_grabber.h"
#endif
#if !defined(OS_MACOSX)
@@ -654,10 +655,10 @@ class PolicyTest : public InProcessBrowserTest {
}
#if defined(OS_CHROMEOS)
- class QuitMessageLoopAfterScreenshot : public ScreenshotTakerObserver {
+ class QuitMessageLoopAfterScreenshot : public ui::ScreenshotGrabberObserver {
public:
virtual void OnScreenshotCompleted(
- ScreenshotTakerObserver::Result screenshot_result,
+ ScreenshotGrabberObserver::Result screenshot_result,
const base::FilePath& screenshot_path) override {
BrowserThread::PostTaskAndReply(BrowserThread::IO,
FROM_HERE,
@@ -670,19 +671,25 @@ class PolicyTest : public InProcessBrowserTest {
void TestScreenshotFile(bool enabled) {
// AddObserver is an ash-specific method, so just replace the screenshot
- // taker with one we've created here.
- scoped_ptr<ScreenshotTaker> screenshot_taker(new ScreenshotTaker);
- // ScreenshotTaker doesn't own this observer, so the observer's lifetime
+ // grabber with one we've created here.
+ scoped_ptr<ChromeScreenshotGrabber> chrome_screenshot_grabber(
+ new ChromeScreenshotGrabber);
+ // ScreenshotGrabber doesn't own this observer, so the observer's lifetime
// is tied to the test instead.
- screenshot_taker->AddObserver(&observer_);
+ chrome_screenshot_grabber->screenshot_grabber()->AddObserver(&observer_);
ash::Shell::GetInstance()->accelerator_controller()->SetScreenshotDelegate(
- screenshot_taker.Pass());
+ chrome_screenshot_grabber.Pass());
SetScreenshotPolicy(enabled);
ash::Shell::GetInstance()->accelerator_controller()->PerformActionIfEnabled(
ash::TAKE_SCREENSHOT);
content::RunMessageLoop();
+ static_cast<ChromeScreenshotGrabber*>(ash::Shell::GetInstance()
+ ->accelerator_controller()
+ ->screenshot_delegate())
+ ->screenshot_grabber()
+ ->RemoveObserver(&observer_);
}
#endif
« no previous file with comments | « no previous file | chrome/browser/ui/ash/ash_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698