Chromium Code Reviews| 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 } |
| 122 | 118 |
| 123 void PlatformWindowMus::Show() { | 119 void PlatformWindowMus::Show() { |
| 124 mus_window_->SetVisible(true); | 120 NOTIMPLEMENTED(); |
| 125 } | 121 } |
| 126 | 122 |
| 127 void PlatformWindowMus::Hide() { | 123 void PlatformWindowMus::Hide() { |
| 128 mus_window_->SetVisible(false); | 124 NOTIMPLEMENTED(); |
| 129 } | 125 } |
| 130 | 126 |
| 131 void PlatformWindowMus::Close() { | 127 void PlatformWindowMus::Close() { |
| 132 NOTIMPLEMENTED(); | 128 NOTIMPLEMENTED(); |
| 133 } | 129 } |
| 134 | 130 |
| 135 void PlatformWindowMus::SetBounds(const gfx::Rect& bounds) { | 131 void PlatformWindowMus::SetBounds(const gfx::Rect& bounds) { |
| 136 mus_window_->SetBounds(bounds); | 132 NOTIMPLEMENTED(); |
|
sadrul
2016/05/09 16:38:26
Add a class-level comment that PlatformWindowMus i
Mark Dittmer
2016/05/09 19:04:44
Addressed in https://codereview.chromium.org/19532
| |
| 137 } | 133 } |
| 138 | 134 |
| 139 gfx::Rect PlatformWindowMus::GetBounds() { | 135 gfx::Rect PlatformWindowMus::GetBounds() { |
| 140 return mus_window_->bounds(); | 136 return mus_window_->bounds(); |
| 141 } | 137 } |
| 142 | 138 |
| 143 void PlatformWindowMus::SetTitle(const base::string16& title) { | 139 void PlatformWindowMus::SetTitle(const base::string16& title) { |
| 144 NOTIMPLEMENTED(); | 140 NOTIMPLEMENTED(); |
| 145 } | 141 } |
| 146 | 142 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 | 269 |
| 274 std::unique_ptr<ui::Event> event = ui::Event::Clone(event_in); | 270 std::unique_ptr<ui::Event> event = ui::Event::Clone(event_in); |
| 275 delegate_->DispatchEvent(event.get()); | 271 delegate_->DispatchEvent(event.get()); |
| 276 // NOTE: |this| may be deleted. | 272 // NOTE: |this| may be deleted. |
| 277 | 273 |
| 278 ack_handler.set_handled(event->handled()); | 274 ack_handler.set_handled(event->handled()); |
| 279 // |ack_handler| acks the event on destruction if necessary. | 275 // |ack_handler| acks the event on destruction if necessary. |
| 280 } | 276 } |
| 281 | 277 |
| 282 } // namespace views | 278 } // namespace views |
| OLD | NEW |