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 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 MockRenderWidgetHostDelegate() {} | 142 MockRenderWidgetHostDelegate() {} |
143 ~MockRenderWidgetHostDelegate() override {} | 143 ~MockRenderWidgetHostDelegate() override {} |
144 const NativeWebKeyboardEvent* last_event() const { return last_event_.get(); } | 144 const NativeWebKeyboardEvent* last_event() const { return last_event_.get(); } |
145 protected: | 145 protected: |
146 // RenderWidgetHostDelegate: | 146 // RenderWidgetHostDelegate: |
147 bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 147 bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
148 bool* is_keyboard_shortcut) override { | 148 bool* is_keyboard_shortcut) override { |
149 last_event_.reset(new NativeWebKeyboardEvent(event)); | 149 last_event_.reset(new NativeWebKeyboardEvent(event)); |
150 return true; | 150 return true; |
151 } | 151 } |
| 152 void Cut() override {} |
| 153 void Copy() override {} |
| 154 void Paste() override {} |
152 private: | 155 private: |
153 scoped_ptr<NativeWebKeyboardEvent> last_event_; | 156 scoped_ptr<NativeWebKeyboardEvent> last_event_; |
154 DISALLOW_COPY_AND_ASSIGN(MockRenderWidgetHostDelegate); | 157 DISALLOW_COPY_AND_ASSIGN(MockRenderWidgetHostDelegate); |
155 }; | 158 }; |
156 | 159 |
157 // Simple observer that keeps track of changes to a window for tests. | 160 // Simple observer that keeps track of changes to a window for tests. |
158 class TestWindowObserver : public aura::WindowObserver { | 161 class TestWindowObserver : public aura::WindowObserver { |
159 public: | 162 public: |
160 explicit TestWindowObserver(aura::Window* window_to_observe) | 163 explicit TestWindowObserver(aura::Window* window_to_observe) |
161 : window_(window_to_observe) { | 164 : window_(window_to_observe) { |
(...skipping 3470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3632 ViewMsg_SetSurfaceIdNamespace::Read(msg, ¶ms); | 3635 ViewMsg_SetSurfaceIdNamespace::Read(msg, ¶ms); |
3633 view_->InitAsChild(NULL); | 3636 view_->InitAsChild(NULL); |
3634 view_->Show(); | 3637 view_->Show(); |
3635 view_->SetSize(size); | 3638 view_->SetSize(size); |
3636 view_->OnSwapCompositorFrame(0, | 3639 view_->OnSwapCompositorFrame(0, |
3637 MakeDelegatedFrame(1.f, size, gfx::Rect(size))); | 3640 MakeDelegatedFrame(1.f, size, gfx::Rect(size))); |
3638 EXPECT_EQ(view_->GetSurfaceIdNamespace(), base::get<0>(params)); | 3641 EXPECT_EQ(view_->GetSurfaceIdNamespace(), base::get<0>(params)); |
3639 } | 3642 } |
3640 | 3643 |
3641 } // namespace content | 3644 } // namespace content |
OLD | NEW |