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

Side by Side Diff: content/browser/android/content_view_core_impl.h

Issue 2300463002: Add observers for DIP scale change. (Closed)
Patch Set: Do not force layout during initialization. Created 4 years, 2 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 JNIEnv* env, 217 JNIEnv* env,
218 const base::android::JavaParamRef<jobject>& obj, 218 const base::android::JavaParamRef<jobject>& obj,
219 jboolean enabled); 219 jboolean enabled);
220 220
221 long GetNativeImeAdapter(JNIEnv* env, 221 long GetNativeImeAdapter(JNIEnv* env,
222 const base::android::JavaParamRef<jobject>& obj); 222 const base::android::JavaParamRef<jobject>& obj);
223 void SetFocus(JNIEnv* env, 223 void SetFocus(JNIEnv* env,
224 const base::android::JavaParamRef<jobject>& obj, 224 const base::android::JavaParamRef<jobject>& obj,
225 jboolean focused); 225 jboolean focused);
226 226
227 void SetDIPScale(JNIEnv* env,
228 const base::android::JavaParamRef<jobject>& obj,
229 jfloat dipScale,
230 jboolean forceLayout);
231
227 jint GetBackgroundColor(JNIEnv* env, jobject obj); 232 jint GetBackgroundColor(JNIEnv* env, jobject obj);
228 void SetAllowJavascriptInterfacesInspection( 233 void SetAllowJavascriptInterfacesInspection(
229 JNIEnv* env, 234 JNIEnv* env,
230 const base::android::JavaParamRef<jobject>& obj, 235 const base::android::JavaParamRef<jobject>& obj,
231 jboolean allow); 236 jboolean allow);
232 void AddJavascriptInterface( 237 void AddJavascriptInterface(
233 JNIEnv* env, 238 JNIEnv* env,
234 const base::android::JavaParamRef<jobject>& obj, 239 const base::android::JavaParamRef<jobject>& obj,
235 const base::android::JavaParamRef<jobject>& object, 240 const base::android::JavaParamRef<jobject>& object,
236 const base::android::JavaParamRef<jstring>& name, 241 const base::android::JavaParamRef<jstring>& name,
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 // -------------------------------------------------------------------------- 381 // --------------------------------------------------------------------------
377 // Methods called from native code 382 // Methods called from native code
378 // -------------------------------------------------------------------------- 383 // --------------------------------------------------------------------------
379 384
380 gfx::Size GetPhysicalBackingSize() const; 385 gfx::Size GetPhysicalBackingSize() const;
381 gfx::Size GetViewportSizeDip() const; 386 gfx::Size GetViewportSizeDip() const;
382 bool DoTopControlsShrinkBlinkSize() const; 387 bool DoTopControlsShrinkBlinkSize() const;
383 float GetTopControlsHeightDip() const; 388 float GetTopControlsHeightDip() const;
384 float GetBottomControlsHeightDip() const; 389 float GetBottomControlsHeightDip() const;
385 390
391 void ForceLayout();
boliu 2016/10/18 00:26:25 private?
Tima Vaisburd 2016/10/19 01:15:54 Thank you. Done.
386 void MoveRangeSelectionExtent(const gfx::PointF& extent); 392 void MoveRangeSelectionExtent(const gfx::PointF& extent);
387 393
388 void SelectBetweenCoordinates(const gfx::PointF& base, 394 void SelectBetweenCoordinates(const gfx::PointF& base,
389 const gfx::PointF& extent); 395 const gfx::PointF& extent);
390 396
391 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); 397 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip);
392 398
393 ui::ViewAndroid* GetViewAndroid(); 399 ui::ViewAndroid* GetViewAndroid();
394 400
395 private: 401 private:
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 ui::ViewAndroid view_; 452 ui::ViewAndroid view_;
447 453
448 // Reference to the current WebContents used to determine how and what to 454 // Reference to the current WebContents used to determine how and what to
449 // display in the ContentViewCore. 455 // display in the ContentViewCore.
450 WebContentsImpl* web_contents_; 456 WebContentsImpl* web_contents_;
451 457
452 // Page scale factor. 458 // Page scale factor.
453 float page_scale_; 459 float page_scale_;
454 460
455 // Device scale factor. 461 // Device scale factor.
456 const float dpi_scale_; 462 float dpi_scale_;
457 463
458 // Observer to notify of lifecyle changes. 464 // Observer to notify of lifecyle changes.
459 base::ObserverList<ContentViewCoreImplObserver> observer_list_; 465 base::ObserverList<ContentViewCoreImplObserver> observer_list_;
460 466
461 // The cache of device's current orientation set from Java side, this value 467 // The cache of device's current orientation set from Java side, this value
462 // will be sent to Renderer once it is ready. 468 // will be sent to Renderer once it is ready.
463 int device_orientation_; 469 int device_orientation_;
464 470
465 bool accessibility_enabled_; 471 bool accessibility_enabled_;
466 472
467 // Manages injecting Java objects. 473 // Manages injecting Java objects.
468 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; 474 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_;
469 475
470 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); 476 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl);
471 }; 477 };
472 478
473 bool RegisterContentViewCore(JNIEnv* env); 479 bool RegisterContentViewCore(JNIEnv* env);
474 480
475 } // namespace content 481 } // namespace content
476 482
477 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 483 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698