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 #include "ui/views/widget/android/native_widget_android.h" | 5 #include "ui/views/widget/android/native_widget_android.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 #include "ui/wm/core/focus_controller.h" | 43 #include "ui/wm/core/focus_controller.h" |
44 #include "ui/wm/core/shadow_types.h" | 44 #include "ui/wm/core/shadow_types.h" |
45 #include "ui/wm/core/window_animations.h" | 45 #include "ui/wm/core/window_animations.h" |
46 #include "ui/wm/core/window_util.h" | 46 #include "ui/wm/core/window_util.h" |
47 #include "ui/wm/public/activation_client.h" | 47 #include "ui/wm/public/activation_client.h" |
48 #include "ui/wm/public/dispatcher_client.h" | 48 #include "ui/wm/public/dispatcher_client.h" |
49 #include "ui/wm/public/drag_drop_client.h" | 49 #include "ui/wm/public/drag_drop_client.h" |
50 #include "ui/wm/public/window_move_client.h" | 50 #include "ui/wm/public/window_move_client.h" |
51 #include "ui/wm/public/window_types.h" | 51 #include "ui/wm/public/window_types.h" |
52 | 52 |
53 // TODO(bshe): Most of the code is copied from NativeWidgetAura or | |
54 // DesktopNativeWidgetAura. Share more code instead of duplicate code when | |
55 // possible. crbug.com/554961. | |
56 namespace { | 53 namespace { |
57 | 54 |
58 class WindowTreeClientImpl : public aura::client::WindowTreeClient { | 55 class WindowTreeClientImpl : public aura::client::WindowTreeClient { |
59 public: | 56 public: |
60 explicit WindowTreeClientImpl(aura::Window* root_window) | 57 explicit WindowTreeClientImpl(aura::Window* root_window) |
61 : root_window_(root_window) { | 58 : root_window_(root_window) { |
62 aura::client::SetWindowTreeClient(root_window_, this); | 59 aura::client::SetWindowTreeClient(root_window_, this); |
63 } | 60 } |
64 ~WindowTreeClientImpl() override { | 61 ~WindowTreeClientImpl() override { |
65 aura::client::SetWindowTreeClient(root_window_, nullptr); | 62 aura::client::SetWindowTreeClient(root_window_, nullptr); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 | 129 |
133 void NativeWidgetAndroid::InitNativeWidget(const Widget::InitParams& params) { | 130 void NativeWidgetAndroid::InitNativeWidget(const Widget::InitParams& params) { |
134 ownership_ = params.ownership; | 131 ownership_ = params.ownership; |
135 NativeWidgetAura::RegisterNativeWidgetForWindow(this, window_); | 132 NativeWidgetAura::RegisterNativeWidgetForWindow(this, window_); |
136 | 133 |
137 window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); | 134 window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); |
138 window_->Init(params.layer_type); | 135 window_->Init(params.layer_type); |
139 wm::SetShadowType(window_, wm::SHADOW_TYPE_NONE); | 136 wm::SetShadowType(window_, wm::SHADOW_TYPE_NONE); |
140 window_->Show(); | 137 window_->Show(); |
141 | 138 |
142 // TODO(bshe): Get rid of the hard coded size. Tracked in crbug.com/551923. | |
143 host_.reset(aura::WindowTreeHost::Create(gfx::Rect(0, 0, 800, 600))); | 139 host_.reset(aura::WindowTreeHost::Create(gfx::Rect(0, 0, 800, 600))); |
144 host_->InitHost(); | 140 host_->InitHost(); |
145 host_->AddObserver(this); | 141 host_->AddObserver(this); |
146 | 142 |
147 window_tree_client_.reset(new WindowTreeClientImpl(host_->window())); | 143 window_tree_client_.reset(new WindowTreeClientImpl(host_->window())); |
148 | 144 |
149 focus_client_.reset(new wm::FocusController(new AndroidFocusRules)); | 145 focus_client_.reset(new wm::FocusController(new AndroidFocusRules)); |
150 aura::client::SetFocusClient(host_->window(), focus_client_.get()); | 146 aura::client::SetFocusClient(host_->window(), focus_client_.get()); |
151 host_->window()->AddPreTargetHandler(focus_client_.get()); | 147 host_->window()->AddPreTargetHandler(focus_client_.get()); |
152 | 148 |
(...skipping 17 matching lines...) Expand all Loading... | |
170 if (params.type != Widget::InitParams::TYPE_TOOLTIP && | 166 if (params.type != Widget::InitParams::TYPE_TOOLTIP && |
171 params.type != Widget::InitParams::TYPE_POPUP) { | 167 params.type != Widget::InitParams::TYPE_POPUP) { |
172 aura::client::SetDragDropDelegate(window_, this); | 168 aura::client::SetDragDropDelegate(window_, this); |
173 } | 169 } |
174 | 170 |
175 aura::client::SetActivationDelegate(window_, this); | 171 aura::client::SetActivationDelegate(window_, this); |
176 | 172 |
177 host_->window()->AddChild(window_); | 173 host_->window()->AddChild(window_); |
178 window_reorderer_.reset( | 174 window_reorderer_.reset( |
179 new WindowReorderer(window_, GetWidget()->GetRootView())); | 175 new WindowReorderer(window_, GetWidget()->GetRootView())); |
180 | |
181 // TODO(bshe): figure out how to add cursor manager, drag drop client and all | |
182 // the necessary parts that exists in desktop_native_widget_aura. | |
183 } | 176 } |
184 | 177 |
185 NonClientFrameView* NativeWidgetAndroid::CreateNonClientFrameView() { | 178 NonClientFrameView* NativeWidgetAndroid::CreateNonClientFrameView() { |
186 NOTIMPLEMENTED(); | 179 NOTIMPLEMENTED(); |
187 return nullptr; | 180 return nullptr; |
188 } | 181 } |
189 | 182 |
190 bool NativeWidgetAndroid::ShouldUseNativeFrame() const { | 183 bool NativeWidgetAndroid::ShouldUseNativeFrame() const { |
191 // There is only one frame type for aura. | 184 // There is only one frame type for aura. |
192 return false; | 185 return false; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 | 220 |
228 const ui::Layer* NativeWidgetAndroid::GetLayer() const { | 221 const ui::Layer* NativeWidgetAndroid::GetLayer() const { |
229 return GetNativeWindow()->layer(); | 222 return GetNativeWindow()->layer(); |
230 } | 223 } |
231 | 224 |
232 void NativeWidgetAndroid::ReorderNativeViews() { | 225 void NativeWidgetAndroid::ReorderNativeViews() { |
233 window_reorderer_->ReorderChildWindows(); | 226 window_reorderer_->ReorderChildWindows(); |
234 } | 227 } |
235 | 228 |
236 void NativeWidgetAndroid::ViewRemoved(View* view) { | 229 void NativeWidgetAndroid::ViewRemoved(View* view) { |
237 // TODO(bshe): Implement drag and drop. crbug.com/554029. | |
238 NOTIMPLEMENTED(); | 230 NOTIMPLEMENTED(); |
239 } | 231 } |
240 | 232 |
241 void NativeWidgetAndroid::SetNativeWindowProperty(const char* name, | 233 void NativeWidgetAndroid::SetNativeWindowProperty(const char* name, |
242 void* value) { | 234 void* value) { |
243 GetNativeWindow()->SetNativeWindowProperty(name, value); | 235 GetNativeWindow()->SetNativeWindowProperty(name, value); |
244 } | 236 } |
245 | 237 |
246 void* NativeWidgetAndroid::GetNativeWindowProperty(const char* name) const { | 238 void* NativeWidgetAndroid::GetNativeWindowProperty(const char* name) const { |
247 return GetNativeWindow()->GetNativeWindowProperty(name); | 239 return GetNativeWindow()->GetNativeWindowProperty(name); |
(...skipping 13 matching lines...) Expand all Loading... | |
261 | 253 |
262 bool NativeWidgetAndroid::HasCapture() const { | 254 bool NativeWidgetAndroid::HasCapture() const { |
263 return GetNativeWindow()->HasCapture(); | 255 return GetNativeWindow()->HasCapture(); |
264 } | 256 } |
265 | 257 |
266 ui::InputMethod* NativeWidgetAndroid::GetInputMethod() { | 258 ui::InputMethod* NativeWidgetAndroid::GetInputMethod() { |
267 return host_->GetInputMethod(); | 259 return host_->GetInputMethod(); |
268 } | 260 } |
269 | 261 |
270 void NativeWidgetAndroid::CenterWindow(const gfx::Size& size) { | 262 void NativeWidgetAndroid::CenterWindow(const gfx::Size& size) { |
271 // TODO(bshe): Implement this. See crbug.com/554208. | |
272 NOTIMPLEMENTED(); | 263 NOTIMPLEMENTED(); |
273 } | 264 } |
274 | 265 |
275 void NativeWidgetAndroid::GetWindowPlacement( | 266 void NativeWidgetAndroid::GetWindowPlacement( |
276 gfx::Rect* bounds, | 267 gfx::Rect* bounds, |
277 ui::WindowShowState* show_state) const { | 268 ui::WindowShowState* show_state) const { |
278 // TODO(bshe): Implement this. See crbug.com/554208. | |
279 NOTIMPLEMENTED(); | 269 NOTIMPLEMENTED(); |
280 } | 270 } |
281 | 271 |
282 bool NativeWidgetAndroid::SetWindowTitle(const base::string16& title) { | 272 bool NativeWidgetAndroid::SetWindowTitle(const base::string16& title) { |
283 if (GetNativeWindow()->title() == title) | 273 if (GetNativeWindow()->title() == title) |
284 return false; | 274 return false; |
285 GetNativeWindow()->SetTitle(title); | 275 GetNativeWindow()->SetTitle(title); |
286 return true; | 276 return true; |
287 } | 277 } |
288 | 278 |
289 void NativeWidgetAndroid::SetWindowIcons(const gfx::ImageSkia& window_icon, | 279 void NativeWidgetAndroid::SetWindowIcons(const gfx::ImageSkia& window_icon, |
290 const gfx::ImageSkia& app_icon) { | 280 const gfx::ImageSkia& app_icon) { |
291 // TODO(bshe): Implement this. See crbug.com/554953. | |
292 NOTIMPLEMENTED(); | 281 NOTIMPLEMENTED(); |
293 } | 282 } |
294 | 283 |
295 void NativeWidgetAndroid::InitModalType(ui::ModalType modal_type) { | 284 void NativeWidgetAndroid::InitModalType(ui::ModalType modal_type) { |
296 // TODO(bshe): Implement this. See crbug.com/554208. | |
297 NOTIMPLEMENTED(); | 285 NOTIMPLEMENTED(); |
298 } | 286 } |
299 | 287 |
300 gfx::Rect NativeWidgetAndroid::GetWindowBoundsInScreen() const { | 288 gfx::Rect NativeWidgetAndroid::GetWindowBoundsInScreen() const { |
301 return GetNativeWindow()->GetBoundsInScreen(); | 289 return GetNativeWindow()->GetBoundsInScreen(); |
302 } | 290 } |
303 | 291 |
304 gfx::Rect NativeWidgetAndroid::GetClientAreaBoundsInScreen() const { | 292 gfx::Rect NativeWidgetAndroid::GetClientAreaBoundsInScreen() const { |
305 // View-to-screen coordinate system transformations depend on this returning | 293 // View-to-screen coordinate system transformations depend on this returning |
306 // the full window bounds, for example View::ConvertPointToScreen(). | 294 // the full window bounds, for example View::ConvertPointToScreen(). |
307 return GetNativeWindow()->GetBoundsInScreen(); | 295 return GetNativeWindow()->GetBoundsInScreen(); |
308 } | 296 } |
309 | 297 |
310 gfx::Rect NativeWidgetAndroid::GetRestoredBounds() const { | 298 gfx::Rect NativeWidgetAndroid::GetRestoredBounds() const { |
311 // TODO(bshe): Implement this. See crbug.com/554208. | |
312 NOTIMPLEMENTED(); | 299 NOTIMPLEMENTED(); |
313 return gfx::Rect(); | 300 return gfx::Rect(); |
314 } | 301 } |
315 | 302 |
316 void NativeWidgetAndroid::SetBounds(const gfx::Rect& bounds) { | 303 void NativeWidgetAndroid::SetBounds(const gfx::Rect& bounds) { |
317 // TODO(bshe): This may not work. We may need to resize SurfaceView too. See | |
318 // crbug.com/554952. | |
319 host_->SetBounds(bounds); | 304 host_->SetBounds(bounds); |
320 } | 305 } |
321 | 306 |
322 void NativeWidgetAndroid::SetSize(const gfx::Size& size) { | 307 void NativeWidgetAndroid::SetSize(const gfx::Size& size) { |
323 gfx::Rect bounds = host_->GetBounds(); | 308 gfx::Rect bounds = host_->GetBounds(); |
324 SetBounds(gfx::Rect(bounds.origin(), size)); | 309 SetBounds(gfx::Rect(bounds.origin(), size)); |
325 } | 310 } |
326 | 311 |
327 void NativeWidgetAndroid::StackAbove(gfx::NativeView native_view) { | 312 void NativeWidgetAndroid::StackAbove(gfx::NativeView native_view) { |
328 // TODO(bshe): Implements window stacking logic. See crbug.com/554047 | |
329 NOTIMPLEMENTED(); | 313 NOTIMPLEMENTED(); |
330 } | 314 } |
331 | 315 |
332 void NativeWidgetAndroid::StackAtTop() { | 316 void NativeWidgetAndroid::StackAtTop() { |
333 // TODO(bshe): Implements window stacking logic. See crbug.com/554047 | |
334 NOTIMPLEMENTED(); | 317 NOTIMPLEMENTED(); |
335 } | 318 } |
336 | 319 |
337 void NativeWidgetAndroid::StackBelow(gfx::NativeView native_view) { | 320 void NativeWidgetAndroid::StackBelow(gfx::NativeView native_view) { |
338 // TODO(bshe): Implements window stacking logic. See crbug.com/554047 | |
339 NOTIMPLEMENTED(); | 321 NOTIMPLEMENTED(); |
340 } | 322 } |
341 | 323 |
342 void NativeWidgetAndroid::SetShape(SkRegion* region) { | 324 void NativeWidgetAndroid::SetShape(SkRegion* region) { |
343 GetNativeWindow()->layer()->SetAlphaShape(make_scoped_ptr(region)); | 325 GetNativeWindow()->layer()->SetAlphaShape(make_scoped_ptr(region)); |
344 } | 326 } |
345 | 327 |
346 void NativeWidgetAndroid::Close() { | 328 void NativeWidgetAndroid::Close() { |
347 // TODO(bshe): This might not be right. See crbug.com/554259. | |
348 DCHECK(ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); | 329 DCHECK(ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); |
349 GetNativeWindow()->SuppressPaint(); | 330 GetNativeWindow()->SuppressPaint(); |
350 Hide(); | 331 Hide(); |
351 GetNativeWindow()->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_NONE); | 332 GetNativeWindow()->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_NONE); |
352 | 333 |
353 if (!close_widget_factory_.HasWeakPtrs()) { | 334 if (!close_widget_factory_.HasWeakPtrs()) { |
354 base::MessageLoop::current()->PostTask( | 335 base::MessageLoop::current()->PostTask( |
355 FROM_HERE, base::Bind(&NativeWidgetAndroid::CloseNow, | 336 FROM_HERE, base::Bind(&NativeWidgetAndroid::CloseNow, |
356 close_widget_factory_.GetWeakPtr())); | 337 close_widget_factory_.GetWeakPtr())); |
357 } | 338 } |
358 } | 339 } |
359 | 340 |
360 void NativeWidgetAndroid::CloseNow() { | 341 void NativeWidgetAndroid::CloseNow() { |
361 // TODO(bshe): This might not be right. See crbug.com/554259. | |
362 host_->RemoveObserver(this); | 342 host_->RemoveObserver(this); |
363 host_.reset(); | 343 host_.reset(); |
364 delete window_; | 344 delete window_; |
365 } | 345 } |
366 | 346 |
367 void NativeWidgetAndroid::Show() { | 347 void NativeWidgetAndroid::Show() { |
368 host_->Show(); | 348 host_->Show(); |
369 GetNativeWindow()->Show(); | 349 GetNativeWindow()->Show(); |
370 } | 350 } |
371 | 351 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
403 | 383 |
404 void NativeWidgetAndroid::SetAlwaysOnTop(bool on_top) { | 384 void NativeWidgetAndroid::SetAlwaysOnTop(bool on_top) { |
405 GetNativeWindow()->SetProperty(aura::client::kAlwaysOnTopKey, on_top); | 385 GetNativeWindow()->SetProperty(aura::client::kAlwaysOnTopKey, on_top); |
406 } | 386 } |
407 | 387 |
408 bool NativeWidgetAndroid::IsAlwaysOnTop() const { | 388 bool NativeWidgetAndroid::IsAlwaysOnTop() const { |
409 return GetNativeWindow()->GetProperty(aura::client::kAlwaysOnTopKey); | 389 return GetNativeWindow()->GetProperty(aura::client::kAlwaysOnTopKey); |
410 } | 390 } |
411 | 391 |
412 void NativeWidgetAndroid::SetVisibleOnAllWorkspaces(bool always_visible) { | 392 void NativeWidgetAndroid::SetVisibleOnAllWorkspaces(bool always_visible) { |
413 // TODO(bshe): Implement this. See crbug.com/554208. | |
414 NOTIMPLEMENTED(); | 393 NOTIMPLEMENTED(); |
415 } | 394 } |
416 | 395 |
417 void NativeWidgetAndroid::Maximize() { | 396 void NativeWidgetAndroid::Maximize() { |
418 // TODO(bshe): Implement this. See crbug.com/554208. | |
419 NOTIMPLEMENTED(); | 397 NOTIMPLEMENTED(); |
420 } | 398 } |
421 | 399 |
422 void NativeWidgetAndroid::Minimize() { | 400 void NativeWidgetAndroid::Minimize() { |
423 // TODO(bshe): Implement this. See crbug.com/554208. | |
424 NOTIMPLEMENTED(); | 401 NOTIMPLEMENTED(); |
425 } | 402 } |
426 | 403 |
427 bool NativeWidgetAndroid::IsMaximized() const { | 404 bool NativeWidgetAndroid::IsMaximized() const { |
428 // TODO(bshe): Implement this. See crbug.com/554208. | |
429 NOTIMPLEMENTED(); | 405 NOTIMPLEMENTED(); |
430 return false; | 406 return false; |
431 } | 407 } |
432 | 408 |
433 bool NativeWidgetAndroid::IsMinimized() const { | 409 bool NativeWidgetAndroid::IsMinimized() const { |
434 // TODO(bshe): Implement this. See crbug.com/554208. | |
435 NOTIMPLEMENTED(); | 410 NOTIMPLEMENTED(); |
436 return false; | 411 return false; |
437 } | 412 } |
438 | 413 |
439 void NativeWidgetAndroid::Restore() { | 414 void NativeWidgetAndroid::Restore() { |
440 // TODO(bshe): Implement this. See crbug.com/554208. | |
441 NOTIMPLEMENTED(); | 415 NOTIMPLEMENTED(); |
442 } | 416 } |
443 | 417 |
444 void NativeWidgetAndroid::SetFullscreen(bool fullscreen) { | 418 void NativeWidgetAndroid::SetFullscreen(bool fullscreen) { |
445 // TODO(bshe): Implement this. See crbug.com/554208. | |
446 NOTIMPLEMENTED(); | 419 NOTIMPLEMENTED(); |
447 } | 420 } |
448 | 421 |
449 bool NativeWidgetAndroid::IsFullscreen() const { | 422 bool NativeWidgetAndroid::IsFullscreen() const { |
450 // TODO(bshe): Implement this. See crbug.com/554208. | |
451 NOTIMPLEMENTED(); | 423 NOTIMPLEMENTED(); |
452 return false; | 424 return false; |
453 } | 425 } |
454 | 426 |
455 void NativeWidgetAndroid::SetOpacity(unsigned char opacity) { | 427 void NativeWidgetAndroid::SetOpacity(unsigned char opacity) { |
456 GetNativeWindow()->layer()->SetOpacity(opacity / 255.0); | 428 GetNativeWindow()->layer()->SetOpacity(opacity / 255.0); |
457 } | 429 } |
458 | 430 |
459 void NativeWidgetAndroid::SetUseDragFrame(bool use_drag_frame) { | 431 void NativeWidgetAndroid::SetUseDragFrame(bool use_drag_frame) { |
460 NOTIMPLEMENTED(); | 432 NOTIMPLEMENTED(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
500 gfx::Rect NativeWidgetAndroid::GetWorkAreaBoundsInScreen() const { | 472 gfx::Rect NativeWidgetAndroid::GetWorkAreaBoundsInScreen() const { |
501 return gfx::Screen::GetScreenFor(window_) | 473 return gfx::Screen::GetScreenFor(window_) |
502 ->GetDisplayNearestWindow(window_) | 474 ->GetDisplayNearestWindow(window_) |
503 .work_area(); | 475 .work_area(); |
504 } | 476 } |
505 | 477 |
506 Widget::MoveLoopResult NativeWidgetAndroid::RunMoveLoop( | 478 Widget::MoveLoopResult NativeWidgetAndroid::RunMoveLoop( |
507 const gfx::Vector2d& drag_offset, | 479 const gfx::Vector2d& drag_offset, |
508 Widget::MoveLoopSource source, | 480 Widget::MoveLoopSource source, |
509 Widget::MoveLoopEscapeBehavior escape_behavior) { | 481 Widget::MoveLoopEscapeBehavior escape_behavior) { |
510 // TODO(bshe): Implement this. See crbug.com/554208. | |
511 NOTIMPLEMENTED(); | 482 NOTIMPLEMENTED(); |
512 return Widget::MOVE_LOOP_SUCCESSFUL; | 483 return Widget::MOVE_LOOP_SUCCESSFUL; |
513 } | 484 } |
514 | 485 |
515 void NativeWidgetAndroid::EndMoveLoop() { | 486 void NativeWidgetAndroid::EndMoveLoop() { |
516 // TODO(bshe): Implement this. See crbug.com/554208. | |
517 NOTIMPLEMENTED(); | 487 NOTIMPLEMENTED(); |
518 } | 488 } |
519 | 489 |
520 void NativeWidgetAndroid::SetVisibilityChangedAnimationsEnabled(bool value) { | 490 void NativeWidgetAndroid::SetVisibilityChangedAnimationsEnabled(bool value) { |
521 GetNativeWindow()->SetProperty(aura::client::kAnimationsDisabledKey, !value); | 491 GetNativeWindow()->SetProperty(aura::client::kAnimationsDisabledKey, !value); |
522 } | 492 } |
523 | 493 |
524 void NativeWidgetAndroid::SetVisibilityAnimationDuration( | 494 void NativeWidgetAndroid::SetVisibilityAnimationDuration( |
525 const base::TimeDelta& duration) { | 495 const base::TimeDelta& duration) { |
526 wm::SetWindowVisibilityAnimationDuration(GetNativeWindow(), duration); | 496 wm::SetWindowVisibilityAnimationDuration(GetNativeWindow(), duration); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
761 if (window_ == gained_focus) | 731 if (window_ == gained_focus) |
762 delegate_->OnNativeFocus(); | 732 delegate_->OnNativeFocus(); |
763 else if (window_ == lost_focus) | 733 else if (window_ == lost_focus) |
764 delegate_->OnNativeBlur(); | 734 delegate_->OnNativeBlur(); |
765 } | 735 } |
766 | 736 |
767 //////////////////////////////////////////////////////////////////////////////// | 737 //////////////////////////////////////////////////////////////////////////////// |
768 // NativeWidgetAndroid, aura::WindowDragDropDelegate implementation: | 738 // NativeWidgetAndroid, aura::WindowDragDropDelegate implementation: |
769 | 739 |
770 void NativeWidgetAndroid::OnDragEntered(const ui::DropTargetEvent& event) { | 740 void NativeWidgetAndroid::OnDragEntered(const ui::DropTargetEvent& event) { |
771 // TODO: Implement drag and drop. crbug.com/554029. | |
772 NOTIMPLEMENTED(); | 741 NOTIMPLEMENTED(); |
773 } | 742 } |
774 | 743 |
775 int NativeWidgetAndroid::OnDragUpdated(const ui::DropTargetEvent& event) { | 744 int NativeWidgetAndroid::OnDragUpdated(const ui::DropTargetEvent& event) { |
776 // TODO: Implement drag and drop. crbug.com/554029. | |
777 NOTIMPLEMENTED(); | 745 NOTIMPLEMENTED(); |
778 return 0; | 746 return 0; |
779 } | 747 } |
780 | 748 |
781 void NativeWidgetAndroid::OnDragExited() { | 749 void NativeWidgetAndroid::OnDragExited() { |
782 // TODO: Implement drag and drop. crbug.com/554029. | |
783 NOTIMPLEMENTED(); | 750 NOTIMPLEMENTED(); |
784 } | 751 } |
785 | 752 |
786 int NativeWidgetAndroid::OnPerformDrop(const ui::DropTargetEvent& event) { | 753 int NativeWidgetAndroid::OnPerformDrop(const ui::DropTargetEvent& event) { |
sky
2016/01/19 17:05:20
Should we remove this file entirely?
| |
787 // TODO: Implement drag and drop. crbug.com/554029. | |
788 NOTIMPLEMENTED(); | 754 NOTIMPLEMENTED(); |
789 return 0; | 755 return 0; |
790 } | 756 } |
791 | 757 |
792 //////////////////////////////////////////////////////////////////////////////// | 758 //////////////////////////////////////////////////////////////////////////////// |
793 // NativeWidgetAndroid, aura::WindowTreeHostObserver implementation: | 759 // NativeWidgetAndroid, aura::WindowTreeHostObserver implementation: |
794 | 760 |
795 void NativeWidgetAndroid::OnHostCloseRequested( | 761 void NativeWidgetAndroid::OnHostCloseRequested( |
796 const aura::WindowTreeHost* host) { | 762 const aura::WindowTreeHost* host) { |
797 GetWidget()->Close(); | 763 GetWidget()->Close(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
830 return false; | 796 return false; |
831 } | 797 } |
832 | 798 |
833 void NativeWidgetAndroid::SetInitialFocus(ui::WindowShowState show_state) { | 799 void NativeWidgetAndroid::SetInitialFocus(ui::WindowShowState show_state) { |
834 // The window does not get keyboard messages unless we focus it. | 800 // The window does not get keyboard messages unless we focus it. |
835 if (!GetWidget()->SetInitialFocus(show_state)) | 801 if (!GetWidget()->SetInitialFocus(show_state)) |
836 window_->Focus(); | 802 window_->Focus(); |
837 } | 803 } |
838 | 804 |
839 } // namespace views | 805 } // namespace views |
OLD | NEW |