Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 public content::TextInputManager::Observer, | 71 public content::TextInputManager::Observer, |
| 72 public ui::DelegatedFrameHostAndroid::Client, | 72 public ui::DelegatedFrameHostAndroid::Client, |
| 73 public cc::BeginFrameObserver { | 73 public cc::BeginFrameObserver { |
| 74 public: | 74 public: |
| 75 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, | 75 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, |
| 76 ContentViewCoreImpl* content_view_core); | 76 ContentViewCoreImpl* content_view_core); |
| 77 ~RenderWidgetHostViewAndroid() override; | 77 ~RenderWidgetHostViewAndroid() override; |
| 78 | 78 |
| 79 void Blur(); | 79 void Blur(); |
| 80 | 80 |
| 81 // Interface used to observe the destruction of a RenderWidgetHostViewAndroid. | |
| 82 class DestructionObserver { | |
| 83 public: | |
| 84 virtual void RenderWidgetHostViewDestroyed( | |
| 85 RenderWidgetHostViewAndroid* rwhva) = 0; | |
| 86 | |
| 87 protected: | |
| 88 virtual ~DestructionObserver() {} | |
| 89 }; | |
| 90 | |
| 91 void AddDestructionObserver(DestructionObserver* connector); | |
| 92 void RemoveDestructionObserver(DestructionObserver* connector); | |
| 93 | |
| 81 // RenderWidgetHostView implementation. | 94 // RenderWidgetHostView implementation. |
| 82 bool OnMessageReceived(const IPC::Message& msg) override; | 95 bool OnMessageReceived(const IPC::Message& msg) override; |
| 83 void InitAsChild(gfx::NativeView parent_view) override; | 96 void InitAsChild(gfx::NativeView parent_view) override; |
| 84 void InitAsPopup(RenderWidgetHostView* parent_host_view, | 97 void InitAsPopup(RenderWidgetHostView* parent_host_view, |
| 85 const gfx::Rect& pos) override; | 98 const gfx::Rect& pos) override; |
| 86 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; | 99 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; |
| 87 RenderWidgetHost* GetRenderWidgetHost() const override; | 100 RenderWidgetHost* GetRenderWidgetHost() const override; |
| 88 void SetSize(const gfx::Size& size) override; | 101 void SetSize(const gfx::Size& size) override; |
| 89 void SetBounds(const gfx::Rect& rect) override; | 102 void SetBounds(const gfx::Rect& rect) override; |
| 90 gfx::Vector2dF GetLastScrollOffset() const override; | 103 gfx::Vector2dF GetLastScrollOffset() const override; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 | 410 |
| 398 // The last scroll offset of the view. | 411 // The last scroll offset of the view. |
| 399 gfx::Vector2dF last_scroll_offset_; | 412 gfx::Vector2dF last_scroll_offset_; |
| 400 | 413 |
| 401 float prev_top_shown_pix_; | 414 float prev_top_shown_pix_; |
| 402 float prev_bottom_shown_pix_; | 415 float prev_bottom_shown_pix_; |
| 403 | 416 |
| 404 cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ = | 417 cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ = |
| 405 nullptr; | 418 nullptr; |
| 406 | 419 |
| 420 std::list<DestructionObserver*> destruction_observers_; | |
|
boliu
2017/04/14 01:10:07
nit: vector is generally more memory efficient and
Jinsuk Kim
2017/04/14 02:16:33
Done.
| |
| 421 | |
| 407 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 422 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
| 408 | 423 |
| 409 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 424 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 410 }; | 425 }; |
| 411 | 426 |
| 412 } // namespace content | 427 } // namespace content |
| 413 | 428 |
| 414 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 429 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |