| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/android/composited_touch_handle_drawable.h" | 5 #include "content/browser/android/composited_touch_handle_drawable.h" |
| 6 | 6 |
| 7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 void LoadIfNecessary(jobject context) { | 33 void LoadIfNecessary(jobject context) { |
| 34 if (loaded_) | 34 if (loaded_) |
| 35 return; | 35 return; |
| 36 | 36 |
| 37 loaded_ = true; | 37 loaded_ = true; |
| 38 | 38 |
| 39 TRACE_EVENT0("browser", "HandleResources::Create"); | 39 TRACE_EVENT0("browser", "HandleResources::Create"); |
| 40 JNIEnv* env = base::android::AttachCurrentThread(); | 40 JNIEnv* env = base::android::AttachCurrentThread(); |
| 41 if (!context) | 41 if (!context) |
| 42 context = base::android::GetApplicationContext(); | 42 context = base::android::GetApplicationContext().obj(); |
| 43 | 43 |
| 44 left_bitmap_ = CreateSkBitmapFromJavaBitmap( | 44 left_bitmap_ = CreateSkBitmapFromJavaBitmap( |
| 45 Java_HandleViewResources_getLeftHandleBitmap(env, context)); | 45 Java_HandleViewResources_getLeftHandleBitmap(env, context)); |
| 46 right_bitmap_ = CreateSkBitmapFromJavaBitmap( | 46 right_bitmap_ = CreateSkBitmapFromJavaBitmap( |
| 47 Java_HandleViewResources_getRightHandleBitmap(env, context)); | 47 Java_HandleViewResources_getRightHandleBitmap(env, context)); |
| 48 center_bitmap_ = CreateSkBitmapFromJavaBitmap( | 48 center_bitmap_ = CreateSkBitmapFromJavaBitmap( |
| 49 Java_HandleViewResources_getCenterHandleBitmap(env, context)); | 49 Java_HandleViewResources_getCenterHandleBitmap(env, context)); |
| 50 | 50 |
| 51 left_bitmap_.setImmutable(); | 51 left_bitmap_.setImmutable(); |
| 52 right_bitmap_.setImmutable(); | 52 right_bitmap_.setImmutable(); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 void CompositedTouchHandleDrawable::DetachLayer() { | 174 void CompositedTouchHandleDrawable::DetachLayer() { |
| 175 layer_->RemoveFromParent(); | 175 layer_->RemoveFromParent(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void CompositedTouchHandleDrawable::UpdateLayerPosition() { | 178 void CompositedTouchHandleDrawable::UpdateLayerPosition() { |
| 179 layer_->SetPosition(origin_position_); | 179 layer_->SetPosition(origin_position_); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace content | 182 } // namespace content |
| OLD | NEW |