OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/aura/desktop.h" | 5 #include "ui/aura/desktop.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 } | 406 } |
407 | 407 |
408 void Desktop::RemoveObserver(DesktopObserver* observer) { | 408 void Desktop::RemoveObserver(DesktopObserver* observer) { |
409 observers_.RemoveObserver(observer); | 409 observers_.RemoveObserver(observer); |
410 } | 410 } |
411 | 411 |
412 bool Desktop::IsMouseButtonDown() const { | 412 bool Desktop::IsMouseButtonDown() const { |
413 return mouse_button_flags_ != 0; | 413 return mouse_button_flags_ != 0; |
414 } | 414 } |
415 | 415 |
| 416 void Desktop::PostNativeEvent(const base::NativeEvent& native_event) { |
| 417 host_->PostNativeEvent(native_event); |
| 418 } |
| 419 |
416 void Desktop::SetCapture(Window* window) { | 420 void Desktop::SetCapture(Window* window) { |
417 if (capture_window_ == window) | 421 if (capture_window_ == window) |
418 return; | 422 return; |
419 | 423 |
420 if (capture_window_ && capture_window_->delegate()) | 424 if (capture_window_ && capture_window_->delegate()) |
421 capture_window_->delegate()->OnCaptureLost(); | 425 capture_window_->delegate()->OnCaptureLost(); |
422 capture_window_ = window; | 426 capture_window_ = window; |
423 | 427 |
424 if (capture_window_) { | 428 if (capture_window_) { |
425 // Make all subsequent mouse events and touch go to the capture window. We | 429 // Make all subsequent mouse events and touch go to the capture window. We |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 614 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
611 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 615 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
612 } else if (use_fullscreen_host_window_) { | 616 } else if (use_fullscreen_host_window_) { |
613 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); | 617 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); |
614 } | 618 } |
615 | 619 |
616 return bounds; | 620 return bounds; |
617 } | 621 } |
618 | 622 |
619 } // namespace aura | 623 } // namespace aura |
OLD | NEW |