OLD | NEW |
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 #include "chrome/browser/ui/views/ash/screenshot_taker.h" | 5 #include "chrome/browser/ui/views/ash/screenshot_taker.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 | 83 |
84 void ScreenshotTaker::HandleTakePartialScreenshot( | 84 void ScreenshotTaker::HandleTakePartialScreenshot( |
85 aura::Window* window, const gfx::Rect& rect) { | 85 aura::Window* window, const gfx::Rect& rect) { |
86 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 86 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
87 | 87 |
88 scoped_refptr<RefCountedBytes> png_data(new RefCountedBytes); | 88 scoped_refptr<RefCountedBytes> png_data(new RefCountedBytes); |
89 | 89 |
90 bool is_logged_in = true; | 90 bool is_logged_in = true; |
91 #if defined(OS_CHROMEOS) | 91 #if defined(OS_CHROMEOS) |
92 is_logged_in = chromeos::UserManager::Get()->user_is_logged_in(); | 92 is_logged_in = chromeos::UserManager::Get()->IsUserLoggedIn(); |
93 #endif | 93 #endif |
94 | 94 |
95 if (browser::GrabWindowSnapshot(window, &png_data->data(), rect)) { | 95 if (browser::GrabWindowSnapshot(window, &png_data->data(), rect)) { |
96 DisplayVisualFeedback(rect); | 96 DisplayVisualFeedback(rect); |
97 content::BrowserThread::PostTask( | 97 content::BrowserThread::PostTask( |
98 content::BrowserThread::FILE, FROM_HERE, | 98 content::BrowserThread::FILE, FROM_HERE, |
99 base::Bind(&SaveScreenshot, is_logged_in, png_data)); | 99 base::Bind(&SaveScreenshot, is_logged_in, png_data)); |
100 } else { | 100 } else { |
101 LOG(ERROR) << "Failed to grab the window screenshot"; | 101 LOG(ERROR) << "Failed to grab the window screenshot"; |
102 } | 102 } |
(...skipping 17 matching lines...) Expand all Loading... |
120 ash::internal::kShellWindowId_OverlayContainer)->layer(); | 120 ash::internal::kShellWindowId_OverlayContainer)->layer(); |
121 parent->Add(visual_feedback_layer_.get()); | 121 parent->Add(visual_feedback_layer_.get()); |
122 visual_feedback_layer_->SetVisible(true); | 122 visual_feedback_layer_->SetVisible(true); |
123 | 123 |
124 MessageLoopForUI::current()->PostDelayedTask( | 124 MessageLoopForUI::current()->PostDelayedTask( |
125 FROM_HERE, | 125 FROM_HERE, |
126 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, | 126 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, |
127 base::Unretained(this)), | 127 base::Unretained(this)), |
128 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); | 128 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); |
129 } | 129 } |
OLD | NEW |