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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 696503002: [Android] Use the Activity context for content selection handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 "content/browser/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 } 1175 }
1176 1176
1177 scoped_ptr<TouchHandleDrawable> RenderWidgetHostViewAndroid::CreateDrawable() { 1177 scoped_ptr<TouchHandleDrawable> RenderWidgetHostViewAndroid::CreateDrawable() {
1178 DCHECK(content_view_core_); 1178 DCHECK(content_view_core_);
1179 if (using_synchronous_compositor_) 1179 if (using_synchronous_compositor_)
1180 return content_view_core_->CreatePopupTouchHandleDrawable(); 1180 return content_view_core_->CreatePopupTouchHandleDrawable();
1181 1181
1182 return scoped_ptr<TouchHandleDrawable>(new CompositedTouchHandleDrawable( 1182 return scoped_ptr<TouchHandleDrawable>(new CompositedTouchHandleDrawable(
1183 content_view_core_->GetLayer().get(), 1183 content_view_core_->GetLayer().get(),
1184 content_view_core_->GetDpiScale(), 1184 content_view_core_->GetDpiScale(),
1185 base::android::GetApplicationContext())); 1185 // Use the activity context (instead of the application context) to ensure
1186 // proper handle theming.
1187 content_view_core_->GetContext().obj()));
1186 } 1188 }
1187 1189
1188 void RenderWidgetHostViewAndroid::SynchronousCopyContents( 1190 void RenderWidgetHostViewAndroid::SynchronousCopyContents(
1189 const gfx::Rect& src_subrect_in_pixel, 1191 const gfx::Rect& src_subrect_in_pixel,
1190 const gfx::Size& dst_size_in_pixel, 1192 const gfx::Size& dst_size_in_pixel,
1191 const base::Callback<void(bool, const SkBitmap&)>& callback, 1193 const base::Callback<void(bool, const SkBitmap&)>& callback,
1192 const SkColorType color_type) { 1194 const SkColorType color_type) {
1193 SynchronousCompositor* compositor = 1195 SynchronousCompositor* compositor =
1194 SynchronousCompositorImpl::FromID(host_->GetProcess()->GetID(), 1196 SynchronousCompositorImpl::FromID(host_->GetProcess()->GetID(),
1195 host_->GetRoutingID()); 1197 host_->GetRoutingID());
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1803 results->orientationAngle = display.RotationAsDegree(); 1805 results->orientationAngle = display.RotationAsDegree();
1804 results->orientationType = 1806 results->orientationType =
1805 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 1807 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
1806 gfx::DeviceDisplayInfo info; 1808 gfx::DeviceDisplayInfo info;
1807 results->depth = info.GetBitsPerPixel(); 1809 results->depth = info.GetBitsPerPixel();
1808 results->depthPerComponent = info.GetBitsPerComponent(); 1810 results->depthPerComponent = info.GetBitsPerComponent();
1809 results->isMonochrome = (results->depthPerComponent == 0); 1811 results->isMonochrome = (results->depthPerComponent == 0);
1810 } 1812 }
1811 1813
1812 } // namespace content 1814 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698