| 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/strings/string_util.h" | 8 #include "base/strings/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/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 #if !defined(OS_CHROMEOS) | 684 #if !defined(OS_CHROMEOS) |
| 685 return DesktopWindowTreeHost::GetNativeTheme(window_); | 685 return DesktopWindowTreeHost::GetNativeTheme(window_); |
| 686 #else | 686 #else |
| 687 return ui::NativeThemeAura::instance(); | 687 return ui::NativeThemeAura::instance(); |
| 688 #endif | 688 #endif |
| 689 } | 689 } |
| 690 | 690 |
| 691 void NativeWidgetAura::OnRootViewLayout() const { | 691 void NativeWidgetAura::OnRootViewLayout() const { |
| 692 } | 692 } |
| 693 | 693 |
| 694 void NativeWidgetAura::RepostNativeEvent(gfx::NativeEvent native_event) { |
| 695 OnEvent(native_event); |
| 696 } |
| 697 |
| 694 //////////////////////////////////////////////////////////////////////////////// | 698 //////////////////////////////////////////////////////////////////////////////// |
| 695 // NativeWidgetAura, views::InputMethodDelegate implementation: | 699 // NativeWidgetAura, views::InputMethodDelegate implementation: |
| 696 | 700 |
| 697 void NativeWidgetAura::DispatchKeyEventPostIME(const ui::KeyEvent& key) { | 701 void NativeWidgetAura::DispatchKeyEventPostIME(const ui::KeyEvent& key) { |
| 698 FocusManager* focus_manager = GetWidget()->GetFocusManager(); | 702 FocusManager* focus_manager = GetWidget()->GetFocusManager(); |
| 699 delegate_->OnKeyEvent(const_cast<ui::KeyEvent*>(&key)); | 703 delegate_->OnKeyEvent(const_cast<ui::KeyEvent*>(&key)); |
| 700 if (key.handled() || !focus_manager) | 704 if (key.handled() || !focus_manager) |
| 701 return; | 705 return; |
| 702 focus_manager->OnKeyEvent(key); | 706 focus_manager->OnKeyEvent(key); |
| 703 } | 707 } |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 drop_helper_->OnDragExit(); | 946 drop_helper_->OnDragExit(); |
| 943 } | 947 } |
| 944 | 948 |
| 945 int NativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { | 949 int NativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { |
| 946 DCHECK(drop_helper_.get() != NULL); | 950 DCHECK(drop_helper_.get() != NULL); |
| 947 return drop_helper_->OnDrop(event.data(), event.location(), | 951 return drop_helper_->OnDrop(event.data(), event.location(), |
| 948 last_drop_operation_); | 952 last_drop_operation_); |
| 949 } | 953 } |
| 950 | 954 |
| 951 //////////////////////////////////////////////////////////////////////////////// | 955 //////////////////////////////////////////////////////////////////////////////// |
| 952 // NativeWidgetAura, NativeWidget implementation: | |
| 953 | |
| 954 ui::EventHandler* NativeWidgetAura::GetEventHandler() { | |
| 955 return this; | |
| 956 } | |
| 957 | |
| 958 //////////////////////////////////////////////////////////////////////////////// | |
| 959 // NativeWidgetAura, protected: | 956 // NativeWidgetAura, protected: |
| 960 | 957 |
| 961 NativeWidgetAura::~NativeWidgetAura() { | 958 NativeWidgetAura::~NativeWidgetAura() { |
| 962 destroying_ = true; | 959 destroying_ = true; |
| 963 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) | 960 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) |
| 964 delete delegate_; | 961 delete delegate_; |
| 965 else | 962 else |
| 966 CloseNow(); | 963 CloseNow(); |
| 967 } | 964 } |
| 968 | 965 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1155 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
| 1159 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1156 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
| 1160 return gfx::FontList(gfx::Font(caption_font)); | 1157 return gfx::FontList(gfx::Font(caption_font)); |
| 1161 #else | 1158 #else |
| 1162 return gfx::FontList(); | 1159 return gfx::FontList(); |
| 1163 #endif | 1160 #endif |
| 1164 } | 1161 } |
| 1165 | 1162 |
| 1166 } // namespace internal | 1163 } // namespace internal |
| 1167 } // namespace views | 1164 } // namespace views |
| OLD | NEW |