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

Side by Side Diff: ui/snapshot/snapshot_android.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 years, 10 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 | « ui/mojo/init/ui_init.cc ('k') | ui/views/bubble/bubble_frame_view.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 #include "ui/snapshot/snapshot.h" 5 #include "ui/snapshot/snapshot.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 23 matching lines...) Expand all
34 return false; 34 return false;
35 } 35 }
36 36
37 static void MakeAsyncCopyRequest( 37 static void MakeAsyncCopyRequest(
38 gfx::NativeWindow window, 38 gfx::NativeWindow window,
39 const gfx::Rect& source_rect, 39 const gfx::Rect& source_rect,
40 const cc::CopyOutputRequest::CopyOutputRequestCallback& callback) { 40 const cc::CopyOutputRequest::CopyOutputRequestCallback& callback) {
41 scoped_ptr<cc::CopyOutputRequest> request = 41 scoped_ptr<cc::CopyOutputRequest> request =
42 cc::CopyOutputRequest::CreateBitmapRequest(callback); 42 cc::CopyOutputRequest::CreateBitmapRequest(callback);
43 43
44 const gfx::Display& display = 44 const gfx::Display& display = gfx::Screen::GetScreen()->GetPrimaryDisplay();
45 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
46 float device_scale_factor = display.device_scale_factor(); 45 float device_scale_factor = display.device_scale_factor();
47 gfx::Rect source_rect_in_pixel = 46 gfx::Rect source_rect_in_pixel =
48 gfx::ScaleToEnclosingRect(source_rect, device_scale_factor); 47 gfx::ScaleToEnclosingRect(source_rect, device_scale_factor);
49 48
50 // Account for the toolbar offset. 49 // Account for the toolbar offset.
51 gfx::Vector2dF offset = window->content_offset(); 50 gfx::Vector2dF offset = window->content_offset();
52 gfx::Rect adjusted_source_rect(gfx::ToRoundedPoint( 51 gfx::Rect adjusted_source_rect(gfx::ToRoundedPoint(
53 gfx::PointF(source_rect_in_pixel.x() + offset.x(), 52 gfx::PointF(source_rect_in_pixel.x() + offset.x(),
54 source_rect_in_pixel.y() + offset.y())), 53 source_rect_in_pixel.y() + offset.y())),
55 source_rect_in_pixel.size()); 54 source_rect_in_pixel.size());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void GrabViewSnapshotAsync( 86 void GrabViewSnapshotAsync(
88 gfx::NativeView view, 87 gfx::NativeView view,
89 const gfx::Rect& source_rect, 88 const gfx::Rect& source_rect,
90 scoped_refptr<base::TaskRunner> background_task_runner, 89 scoped_refptr<base::TaskRunner> background_task_runner,
91 const GrabWindowSnapshotAsyncPNGCallback& callback) { 90 const GrabWindowSnapshotAsyncPNGCallback& callback) {
92 GrabWindowSnapshotAsync( 91 GrabWindowSnapshotAsync(
93 view->GetWindowAndroid(), source_rect, background_task_runner, callback); 92 view->GetWindowAndroid(), source_rect, background_task_runner, callback);
94 } 93 }
95 94
96 } // namespace ui 95 } // namespace ui
OLDNEW
« no previous file with comments | « ui/mojo/init/ui_init.cc ('k') | ui/views/bubble/bubble_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698