| OLD | NEW | 
|    1 // Copyright 2015 The Chromium Authors. All rights reserved. |    1 // Copyright 2015 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 #ifndef BLIMP_CLIENT_APP_ANDROID_BLIMP_VIEW_H_ |    5 #ifndef BLIMP_CLIENT_APP_ANDROID_BLIMP_VIEW_H_ | 
|    6 #define BLIMP_CLIENT_APP_ANDROID_BLIMP_VIEW_H_ |    6 #define BLIMP_CLIENT_APP_ANDROID_BLIMP_VIEW_H_ | 
|    7  |    7  | 
|    8 #include <memory> |    8 #include <memory> | 
|    9  |    9  | 
|   10 #include "base/android/jni_android.h" |   10 #include "base/android/jni_android.h" | 
|   11 #include "base/macros.h" |   11 #include "base/macros.h" | 
|   12 #include "base/memory/weak_ptr.h" |   12 #include "base/memory/weak_ptr.h" | 
|   13 #include "ui/gfx/native_widget_types.h" |   13 #include "ui/gfx/native_widget_types.h" | 
|   14  |   14  | 
|   15 namespace gfx { |   15 namespace gfx { | 
|   16 class Size; |   16 class Size; | 
|   17 } |   17 } | 
|   18  |   18  | 
|   19 namespace blimp { |   19 namespace blimp { | 
|   20 namespace client { |   20 namespace client { | 
|   21 class BlimpCompositorDependencies; |   21 class BlimpCompositorDependencies; | 
|   22 class BlimpCompositorManager; |   22 class BlimpCompositorManager; | 
|   23 class BrowserCompositor; |   23 class BrowserCompositor; | 
|   24 class RenderWidgetFeature; |   24 class RenderWidgetFeature; | 
|   25  |   25  | 
 |   26 namespace app { | 
 |   27  | 
|   26 // The native component of org.chromium.blimp.BlimpView.  This builds and |   28 // The native component of org.chromium.blimp.BlimpView.  This builds and | 
|   27 // maintains a BlimpCompositorAndroid and handles notifying the compositor of |   29 // maintains a BlimpCompositorAndroid and handles notifying the compositor of | 
|   28 // SurfaceView surface changes (size, creation, destruction, etc.). |   30 // SurfaceView surface changes (size, creation, destruction, etc.). | 
|   29 class BlimpView { |   31 class BlimpView { | 
|   30  public: |   32  public: | 
|   31   static bool RegisterJni(JNIEnv* env); |   33   static bool RegisterJni(JNIEnv* env); | 
|   32  |   34  | 
|   33   // |real_size| is the total display area including system decorations (see |   35   // |real_size| is the total display area including system decorations (see | 
|   34   // android.view.Display.getRealSize()).  |size| is the total display |   36   // android.view.Display.getRealSize()).  |size| is the total display | 
|   35   // area not including system decorations (see android.view.Display.getSize()). |   37   // area not including system decorations (see android.view.Display.getSize()). | 
|   36   // |dp_to_px| is the scale factor that is required to convert dp (device |   38   // |dp_to_px| is the scale factor that is required to convert dp (device | 
|   37   // pixels) to px. |   39   // pixels) to px. | 
|   38   BlimpView(JNIEnv* env, |   40   BlimpView(JNIEnv* env, | 
|   39             const base::android::JavaParamRef<jobject>& jobj, |   41             const base::android::JavaParamRef<jobject>& jobj, | 
|   40             const gfx::Size& real_size, |   42             const gfx::Size& real_size, | 
|   41             const gfx::Size& size, |   43             const gfx::Size& size, | 
|   42             float dp_to_px, |   44             float dp_to_px, | 
|   43             RenderWidgetFeature* render_widget_feature); |   45             blimp::client::RenderWidgetFeature* render_widget_feature); | 
|   44  |   46  | 
|   45   // Methods called from Java via JNI. |   47   // Methods called from Java via JNI. | 
|   46   void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& jobj); |   48   void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& jobj); | 
|   47   void OnContentAreaSizeChanged( |   49   void OnContentAreaSizeChanged( | 
|   48       JNIEnv* env, |   50       JNIEnv* env, | 
|   49       const base::android::JavaParamRef<jobject>& jobj, |   51       const base::android::JavaParamRef<jobject>& jobj, | 
|   50       jint width, |   52       jint width, | 
|   51       jint height, |   53       jint height, | 
|   52       jfloat dpToPx); |   54       jfloat dpToPx); | 
|   53   void OnSurfaceChanged(JNIEnv* env, |   55   void OnSurfaceChanged(JNIEnv* env, | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  110   // android.graphics.PixelFormat.java. |  112   // android.graphics.PixelFormat.java. | 
|  111   int current_surface_format_; |  113   int current_surface_format_; | 
|  112  |  114  | 
|  113   gfx::AcceleratedWidget window_; |  115   gfx::AcceleratedWidget window_; | 
|  114  |  116  | 
|  115   base::WeakPtrFactory<BlimpView> weak_ptr_factory_; |  117   base::WeakPtrFactory<BlimpView> weak_ptr_factory_; | 
|  116  |  118  | 
|  117   DISALLOW_COPY_AND_ASSIGN(BlimpView); |  119   DISALLOW_COPY_AND_ASSIGN(BlimpView); | 
|  118 }; |  120 }; | 
|  119  |  121  | 
 |  122 }  // namespace app | 
|  120 }  // namespace client |  123 }  // namespace client | 
|  121 }  // namespace blimp |  124 }  // namespace blimp | 
|  122  |  125  | 
|  123 #endif  // BLIMP_CLIENT_APP_ANDROID_BLIMP_VIEW_H_ |  126 #endif  // BLIMP_CLIENT_APP_ANDROID_BLIMP_VIEW_H_ | 
| OLD | NEW |