| 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/mus/platform_window_mus.h" | 5 #include "ui/views/mus/platform_window_mus.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "components/bitmap_uploader/bitmap_uploader.h" | 9 #include "components/bitmap_uploader/bitmap_uploader.h" |
| 10 #include "components/mus/public/cpp/property_type_converters.h" | 10 #include "components/mus/public/cpp/property_type_converters.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 PlatformWindowMus::~PlatformWindowMus() { | 99 PlatformWindowMus::~PlatformWindowMus() { |
| 100 if (!mus_window_) | 100 if (!mus_window_) |
| 101 return; | 101 return; |
| 102 mus_window_->RemoveObserver(this); | 102 mus_window_->RemoveObserver(this); |
| 103 mus_window_->set_input_event_handler(nullptr); | 103 mus_window_->set_input_event_handler(nullptr); |
| 104 if (!mus_window_destroyed_) | 104 if (!mus_window_destroyed_) |
| 105 mus_window_->Destroy(); | 105 mus_window_->Destroy(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void PlatformWindowMus::Activate() { | |
| 109 mus_window_->SetFocus(); | |
| 110 } | |
| 111 | |
| 112 void PlatformWindowMus::SetCursorById(mus::mojom::Cursor cursor) { | 108 void PlatformWindowMus::SetCursorById(mus::mojom::Cursor cursor) { |
| 113 if (last_cursor_ != cursor) { | 109 if (last_cursor_ != cursor) { |
| 114 // The ui::PlatformWindow interface uses ui::PlatformCursor at this level, | 110 // The ui::PlatformWindow interface uses ui::PlatformCursor at this level, |
| 115 // instead of ui::Cursor. All of the cursor abstractions in ui right now are | 111 // instead of ui::Cursor. All of the cursor abstractions in ui right now are |
| 116 // sort of leaky; despite being nominally cross platform, they all drop down | 112 // sort of leaky; despite being nominally cross platform, they all drop down |
| 117 // to platform types almost immediately, which makes them unusable as | 113 // to platform types almost immediately, which makes them unusable as |
| 118 // transport types. | 114 // transport types. |
| 119 mus_window_->SetPredefinedCursor(cursor); | 115 mus_window_->SetPredefinedCursor(cursor); |
| 120 } | 116 } |
| 121 } | 117 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 267 |
| 272 std::unique_ptr<ui::Event> event = ui::Event::Clone(event_in); | 268 std::unique_ptr<ui::Event> event = ui::Event::Clone(event_in); |
| 273 delegate_->DispatchEvent(event.get()); | 269 delegate_->DispatchEvent(event.get()); |
| 274 // NOTE: |this| may be deleted. | 270 // NOTE: |this| may be deleted. |
| 275 | 271 |
| 276 ack_handler.set_handled(event->handled()); | 272 ack_handler.set_handled(event->handled()); |
| 277 // |ack_handler| acks the event on destruction if necessary. | 273 // |ack_handler| acks the event on destruction if necessary. |
| 278 } | 274 } |
| 279 | 275 |
| 280 } // namespace views | 276 } // namespace views |
| OLD | NEW |