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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 } // namespace | 137 } // namespace |
138 | 138 |
139 // We have to implement the WindowObserver interface on a separate object | 139 // We have to implement the WindowObserver interface on a separate object |
140 // because clang doesn't like implementing multiple interfaces that have | 140 // because clang doesn't like implementing multiple interfaces that have |
141 // methods with the same name. This object is owned by the | 141 // methods with the same name. This object is owned by the |
142 // RenderWidgetHostViewAura. | 142 // RenderWidgetHostViewAura. |
143 class RenderWidgetHostViewAura::WindowObserver : public aura::WindowObserver { | 143 class RenderWidgetHostViewAura::WindowObserver : public aura::WindowObserver { |
144 public: | 144 public: |
145 WindowObserver(RenderWidgetHostViewAura* view) : view_(view) {} | 145 explicit WindowObserver(RenderWidgetHostViewAura* view) : view_(view) {} |
146 virtual ~WindowObserver() {} | 146 virtual ~WindowObserver() {} |
147 | 147 |
148 // Overridden from aura::WindowObserver: | 148 // Overridden from aura::WindowObserver: |
149 virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE { | 149 virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE { |
150 view_->RemovingFromRootWindow(); | 150 view_->RemovingFromRootWindow(); |
151 } | 151 } |
152 | 152 |
153 private: | 153 private: |
154 RenderWidgetHostViewAura* view_; | 154 RenderWidgetHostViewAura* view_; |
155 | 155 |
156 DISALLOW_COPY_AND_ASSIGN(WindowObserver); | 156 DISALLOW_COPY_AND_ASSIGN(WindowObserver); |
157 }; | 157 }; |
158 | 158 |
159 class RenderWidgetHostViewAura::ResizeLock : | 159 class RenderWidgetHostViewAura::ResizeLock |
160 public base::SupportsWeakPtr<RenderWidgetHostViewAura::ResizeLock> { | 160 : public base::SupportsWeakPtr<RenderWidgetHostViewAura::ResizeLock> { |
161 public: | 161 public: |
162 ResizeLock(aura::RootWindow* root_window, const gfx::Size new_size) | 162 ResizeLock(aura::RootWindow* root_window, const gfx::Size new_size) |
163 : root_window_(root_window), | 163 : root_window_(root_window), |
164 new_size_(new_size), | 164 new_size_(new_size), |
165 compositor_lock_(root_window_->GetCompositorLock()) { | 165 compositor_lock_(root_window_->GetCompositorLock()) { |
166 root_window_->HoldMouseMoves(); | 166 root_window_->HoldMouseMoves(); |
167 | 167 |
168 BrowserThread::PostDelayedTask( | 168 BrowserThread::PostDelayedTask( |
169 BrowserThread::UI, FROM_HERE, | 169 BrowserThread::UI, FROM_HERE, |
170 base::Bind(&RenderWidgetHostViewAura::ResizeLock::CancelLock, | 170 base::Bind(&RenderWidgetHostViewAura::ResizeLock::CancelLock, |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 } | 1161 } |
1162 | 1162 |
1163 void RenderWidgetHostViewAura::OnWindowDestroyed() { | 1163 void RenderWidgetHostViewAura::OnWindowDestroyed() { |
1164 host_->ViewDestroyed(); | 1164 host_->ViewDestroyed(); |
1165 delete this; | 1165 delete this; |
1166 } | 1166 } |
1167 | 1167 |
1168 void RenderWidgetHostViewAura::OnWindowVisibilityChanged(bool visible) { | 1168 void RenderWidgetHostViewAura::OnWindowVisibilityChanged(bool visible) { |
1169 } | 1169 } |
1170 | 1170 |
| 1171 bool RenderWidgetHostViewAura::HasHitTestMask() const { |
| 1172 return false; |
| 1173 } |
| 1174 |
| 1175 void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const { |
| 1176 } |
| 1177 |
1171 //////////////////////////////////////////////////////////////////////////////// | 1178 //////////////////////////////////////////////////////////////////////////////// |
1172 // RenderWidgetHostViewAura, aura::client::ActivationDelegate implementation: | 1179 // RenderWidgetHostViewAura, aura::client::ActivationDelegate implementation: |
1173 | 1180 |
1174 bool RenderWidgetHostViewAura::ShouldActivate(const aura::Event* event) { | 1181 bool RenderWidgetHostViewAura::ShouldActivate(const aura::Event* event) { |
1175 if (event && event->type() == ui::ET_MOUSE_PRESSED) | 1182 if (event && event->type() == ui::ET_MOUSE_PRESSED) |
1176 host_->OnMouseActivate(); | 1183 host_->OnMouseActivate(); |
1177 return is_fullscreen_; | 1184 return is_fullscreen_; |
1178 } | 1185 } |
1179 | 1186 |
1180 void RenderWidgetHostViewAura::OnActivated() { | 1187 void RenderWidgetHostViewAura::OnActivated() { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 1381 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
1375 RenderWidgetHost* widget) { | 1382 RenderWidgetHost* widget) { |
1376 return new RenderWidgetHostViewAura(widget); | 1383 return new RenderWidgetHostViewAura(widget); |
1377 } | 1384 } |
1378 | 1385 |
1379 // static | 1386 // static |
1380 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1387 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
1381 WebKit::WebScreenInfo* results) { | 1388 WebKit::WebScreenInfo* results) { |
1382 GetScreenInfoForWindow(results, NULL); | 1389 GetScreenInfoForWindow(results, NULL); |
1383 } | 1390 } |
OLD | NEW |