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/desktop_aura/desktop_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 activation_client->DeactivateWindow(active_window); | 386 activation_client->DeactivateWindow(active_window); |
387 GetInputMethod()->OnBlur(); | 387 GetInputMethod()->OnBlur(); |
388 } | 388 } |
389 } | 389 } |
390 } | 390 } |
391 | 391 |
392 gfx::NativeWindow DesktopNativeWidgetAura::GetNativeWindow() const { | 392 gfx::NativeWindow DesktopNativeWidgetAura::GetNativeWindow() const { |
393 return content_window_; | 393 return content_window_; |
394 } | 394 } |
395 | 395 |
| 396 void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name, |
| 397 void* value) { |
| 398 if (content_window_) |
| 399 content_window_->SetNativeWindowProperty(name, value); |
| 400 } |
| 401 |
396 //////////////////////////////////////////////////////////////////////////////// | 402 //////////////////////////////////////////////////////////////////////////////// |
397 // DesktopNativeWidgetAura, internal::NativeWidgetPrivate implementation: | 403 // DesktopNativeWidgetAura, internal::NativeWidgetPrivate implementation: |
398 | 404 |
399 void DesktopNativeWidgetAura::InitNativeWidget( | 405 void DesktopNativeWidgetAura::InitNativeWidget( |
400 const Widget::InitParams& params) { | 406 const Widget::InitParams& params) { |
401 ownership_ = params.ownership; | 407 ownership_ = params.ownership; |
402 widget_type_ = params.type; | 408 widget_type_ = params.type; |
403 name_ = params.name; | 409 name_ = params.name; |
404 | 410 |
405 NativeWidgetAura::RegisterNativeWidgetForWindow(this, content_window_); | 411 NativeWidgetAura::RegisterNativeWidgetForWindow(this, content_window_); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 | 597 |
592 void DesktopNativeWidgetAura::ReorderNativeViews() { | 598 void DesktopNativeWidgetAura::ReorderNativeViews() { |
593 window_reorderer_->ReorderChildWindows(); | 599 window_reorderer_->ReorderChildWindows(); |
594 } | 600 } |
595 | 601 |
596 void DesktopNativeWidgetAura::ViewRemoved(View* view) { | 602 void DesktopNativeWidgetAura::ViewRemoved(View* view) { |
597 DCHECK(drop_helper_.get() != NULL); | 603 DCHECK(drop_helper_.get() != NULL); |
598 drop_helper_->ResetTargetViewIfEquals(view); | 604 drop_helper_->ResetTargetViewIfEquals(view); |
599 } | 605 } |
600 | 606 |
601 void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name, | |
602 void* value) { | |
603 if (content_window_) | |
604 content_window_->SetNativeWindowProperty(name, value); | |
605 } | |
606 | |
607 void* DesktopNativeWidgetAura::GetNativeWindowProperty(const char* name) const { | 607 void* DesktopNativeWidgetAura::GetNativeWindowProperty(const char* name) const { |
608 return content_window_ ? | 608 return content_window_ ? |
609 content_window_->GetNativeWindowProperty(name) : NULL; | 609 content_window_->GetNativeWindowProperty(name) : NULL; |
610 } | 610 } |
611 | 611 |
612 TooltipManager* DesktopNativeWidgetAura::GetTooltipManager() const { | 612 TooltipManager* DesktopNativeWidgetAura::GetTooltipManager() const { |
613 return tooltip_manager_.get(); | 613 return tooltip_manager_.get(); |
614 } | 614 } |
615 | 615 |
616 void DesktopNativeWidgetAura::SetCapture() { | 616 void DesktopNativeWidgetAura::SetCapture() { |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 if (cursor_reference_count_ == 0) { | 1207 if (cursor_reference_count_ == 0) { |
1208 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1208 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
1209 // for cleaning up |cursor_manager_|. | 1209 // for cleaning up |cursor_manager_|. |
1210 delete cursor_manager_; | 1210 delete cursor_manager_; |
1211 native_cursor_manager_ = NULL; | 1211 native_cursor_manager_ = NULL; |
1212 cursor_manager_ = NULL; | 1212 cursor_manager_ = NULL; |
1213 } | 1213 } |
1214 } | 1214 } |
1215 | 1215 |
1216 } // namespace views | 1216 } // namespace views |
OLD | NEW |