OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "ui/aura/client/activation_client.h" | 9 #include "ui/aura/client/activation_client.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 if (window_) | 521 if (window_) |
522 window_->SchedulePaintInRect(rect); | 522 window_->SchedulePaintInRect(rect); |
523 } | 523 } |
524 | 524 |
525 void NativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { | 525 void NativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { |
526 cursor_ = cursor; | 526 cursor_ = cursor; |
527 aura::RootWindow::GetInstance()->SetCursor(cursor); | 527 aura::RootWindow::GetInstance()->SetCursor(cursor); |
528 } | 528 } |
529 | 529 |
530 void NativeWidgetAura::ClearNativeFocus() { | 530 void NativeWidgetAura::ClearNativeFocus() { |
531 if (window_ && window_->GetFocusManager()) | 531 if (window_ && window_->GetFocusManager() && |
| 532 window_->Contains(window_->GetFocusManager()->GetFocusedWindow())) { |
532 window_->GetFocusManager()->SetFocusedWindow(window_); | 533 window_->GetFocusManager()->SetFocusedWindow(window_); |
| 534 } |
533 } | 535 } |
534 | 536 |
535 void NativeWidgetAura::FocusNativeView(gfx::NativeView native_view) { | 537 void NativeWidgetAura::FocusNativeView(gfx::NativeView native_view) { |
536 window_->GetFocusManager()->SetFocusedWindow(native_view); | 538 window_->GetFocusManager()->SetFocusedWindow(native_view); |
537 } | 539 } |
538 | 540 |
539 gfx::Rect NativeWidgetAura::GetWorkAreaBoundsInScreen() const { | 541 gfx::Rect NativeWidgetAura::GetWorkAreaBoundsInScreen() const { |
540 return gfx::Screen::GetMonitorWorkAreaNearestWindow(GetNativeView()); | 542 return gfx::Screen::GetMonitorWorkAreaNearestWindow(GetNativeView()); |
541 } | 543 } |
542 | 544 |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 } | 853 } |
852 } | 854 } |
853 | 855 |
854 // static | 856 // static |
855 bool NativeWidgetPrivate::IsMouseButtonDown() { | 857 bool NativeWidgetPrivate::IsMouseButtonDown() { |
856 return aura::RootWindow::GetInstance()->IsMouseButtonDown(); | 858 return aura::RootWindow::GetInstance()->IsMouseButtonDown(); |
857 } | 859 } |
858 | 860 |
859 } // namespace internal | 861 } // namespace internal |
860 } // namespace views | 862 } // namespace views |
OLD | NEW |