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/ash/screenshot_taker.h" | 5 #include "chrome/browser/ui/ash/screenshot_taker.h" |
6 | 6 |
7 #include <climits> | 7 #include <climits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 const gfx::Rect& snapshot_bounds, | 115 const gfx::Rect& snapshot_bounds, |
116 std::vector<unsigned char>* png_data) { | 116 std::vector<unsigned char>* png_data) { |
117 #if defined(OS_LINUX) | 117 #if defined(OS_LINUX) |
118 // We use XGetImage() for Linux/ChromeOS for performance reasons. | 118 // We use XGetImage() for Linux/ChromeOS for performance reasons. |
119 // See crbug.com/119492 | 119 // See crbug.com/119492 |
120 // TODO(mukai): remove this when the performance issue has been fixed. | 120 // TODO(mukai): remove this when the performance issue has been fixed. |
121 if (window->GetRootWindow()->GrabSnapshot(snapshot_bounds, png_data)) | 121 if (window->GetRootWindow()->GrabSnapshot(snapshot_bounds, png_data)) |
122 return true; | 122 return true; |
123 #endif // OS_LINUX | 123 #endif // OS_LINUX |
124 | 124 |
125 return browser::GrabWindowSnapshot(window, png_data, snapshot_bounds); | 125 return chrome::GrabWindowSnapshot(window, png_data, snapshot_bounds); |
126 } | 126 } |
127 | 127 |
128 // How opaque should the layer that we flash onscreen to provide visual | 128 // How opaque should the layer that we flash onscreen to provide visual |
129 // feedback after the screenshot is taken be? | 129 // feedback after the screenshot is taken be? |
130 const float kVisualFeedbackLayerOpacity = 0.25f; | 130 const float kVisualFeedbackLayerOpacity = 0.25f; |
131 | 131 |
132 // How long should the visual feedback layer be displayed? | 132 // How long should the visual feedback layer be displayed? |
133 const int64 kVisualFeedbackLayerDisplayTimeMs = 100; | 133 const int64 kVisualFeedbackLayerDisplayTimeMs = 100; |
134 | 134 |
135 } // namespace | 135 } // namespace |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 ash::internal::kShellWindowId_OverlayContainer)->layer(); | 203 ash::internal::kShellWindowId_OverlayContainer)->layer(); |
204 parent->Add(visual_feedback_layer_.get()); | 204 parent->Add(visual_feedback_layer_.get()); |
205 visual_feedback_layer_->SetVisible(true); | 205 visual_feedback_layer_->SetVisible(true); |
206 | 206 |
207 MessageLoopForUI::current()->PostDelayedTask( | 207 MessageLoopForUI::current()->PostDelayedTask( |
208 FROM_HERE, | 208 FROM_HERE, |
209 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, | 209 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, |
210 base::Unretained(this)), | 210 base::Unretained(this)), |
211 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); | 211 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); |
212 } | 212 } |
OLD | NEW |