| 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 "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 "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
| 10 #include "ui/aura/client/activation_change_observer.h" | 10 #include "ui/aura/client/activation_change_observer.h" |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 if (cursor_client) | 652 if (cursor_client) |
| 653 cursor_client->SetCursor(cursor); | 653 cursor_client->SetCursor(cursor); |
| 654 } | 654 } |
| 655 | 655 |
| 656 void NativeWidgetAura::ClearNativeFocus() { | 656 void NativeWidgetAura::ClearNativeFocus() { |
| 657 if (window_ && window_->GetFocusManager() && | 657 if (window_ && window_->GetFocusManager() && |
| 658 window_->Contains(window_->GetFocusManager()->GetFocusedWindow())) | 658 window_->Contains(window_->GetFocusManager()->GetFocusedWindow())) |
| 659 window_->GetFocusManager()->SetFocusedWindow(window_, NULL); | 659 window_->GetFocusManager()->SetFocusedWindow(window_, NULL); |
| 660 } | 660 } |
| 661 | 661 |
| 662 void NativeWidgetAura::FocusNativeView(gfx::NativeView native_view) { | |
| 663 window_->GetFocusManager()->SetFocusedWindow(native_view, NULL); | |
| 664 } | |
| 665 | |
| 666 gfx::Rect NativeWidgetAura::GetWorkAreaBoundsInScreen() const { | 662 gfx::Rect NativeWidgetAura::GetWorkAreaBoundsInScreen() const { |
| 667 return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area(); | 663 return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area(); |
| 668 } | 664 } |
| 669 | 665 |
| 670 void NativeWidgetAura::SetInactiveRenderingDisabled(bool value) { | 666 void NativeWidgetAura::SetInactiveRenderingDisabled(bool value) { |
| 671 if (!value) | 667 if (!value) |
| 672 active_window_observer_.reset(); | 668 active_window_observer_.reset(); |
| 673 else | 669 else |
| 674 active_window_observer_.reset(new ActiveWindowObserver(this)); | 670 active_window_observer_.reset(new ActiveWindowObserver(this)); |
| 675 } | 671 } |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 return aura::Env::GetInstance()->is_mouse_button_down(); | 1065 return aura::Env::GetInstance()->is_mouse_button_down(); |
| 1070 } | 1066 } |
| 1071 | 1067 |
| 1072 // static | 1068 // static |
| 1073 bool NativeWidgetPrivate::IsTouchDown() { | 1069 bool NativeWidgetPrivate::IsTouchDown() { |
| 1074 return aura::Env::GetInstance()->is_touch_down(); | 1070 return aura::Env::GetInstance()->is_touch_down(); |
| 1075 } | 1071 } |
| 1076 | 1072 |
| 1077 } // namespace internal | 1073 } // namespace internal |
| 1078 } // namespace views | 1074 } // namespace views |
| OLD | NEW |