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 14 matching lines...) Expand all Loading... |
25 #include "ui/aura/window_delegate.h" | 25 #include "ui/aura/window_delegate.h" |
26 #include "ui/base/hit_test.h" | 26 #include "ui/base/hit_test.h" |
27 #include "ui/gfx/compositor/compositor.h" | 27 #include "ui/gfx/compositor/compositor.h" |
28 #include "ui/gfx/compositor/layer.h" | 28 #include "ui/gfx/compositor/layer.h" |
29 #include "ui/gfx/compositor/layer_animator.h" | 29 #include "ui/gfx/compositor/layer_animator.h" |
30 | 30 |
31 #ifdef USE_WEBKIT_COMPOSITOR | 31 #ifdef USE_WEBKIT_COMPOSITOR |
32 #include "ui/gfx/compositor/compositor_cc.h" | 32 #include "ui/gfx/compositor/compositor_cc.h" |
33 #endif | 33 #endif |
34 | 34 |
35 #if defined(USE_X11) | |
36 #include "base/message_pump_x.h" | |
37 #endif | |
38 | |
39 using std::string; | 35 using std::string; |
40 using std::vector; | 36 using std::vector; |
41 | 37 |
42 namespace aura { | 38 namespace aura { |
43 | 39 |
44 namespace { | 40 namespace { |
45 | 41 |
46 // Default bounds for the host window. | 42 // Default bounds for the host window. |
47 static const int kDefaultHostWindowX = 200; | 43 static const int kDefaultHostWindowX = 200; |
48 static const int kDefaultHostWindowY = 200; | 44 static const int kDefaultHostWindowY = 200; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 if (ui::Compositor::compositor_factory()) { | 418 if (ui::Compositor::compositor_factory()) { |
423 compositor_ = (*ui::Compositor::compositor_factory())(this); | 419 compositor_ = (*ui::Compositor::compositor_factory())(this); |
424 } else { | 420 } else { |
425 #ifdef USE_WEBKIT_COMPOSITOR | 421 #ifdef USE_WEBKIT_COMPOSITOR |
426 ui::CompositorCC::Initialize(false); | 422 ui::CompositorCC::Initialize(false); |
427 #endif | 423 #endif |
428 compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(), | 424 compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(), |
429 host_->GetSize()); | 425 host_->GetSize()); |
430 } | 426 } |
431 DCHECK(compositor_.get()); | 427 DCHECK(compositor_.get()); |
432 #if defined(USE_X11) | |
433 base::MessagePumpX::SetDefaultDispatcher(host_.get()); | |
434 #endif | |
435 } | 428 } |
436 | 429 |
437 Desktop::~Desktop() { | 430 Desktop::~Desktop() { |
438 #if defined(USE_X11) | |
439 base::MessagePumpX::SetDefaultDispatcher(NULL); | |
440 #endif | |
441 | |
442 in_destructor_ = true; | 431 in_destructor_ = true; |
443 #ifdef USE_WEBKIT_COMPOSITOR | 432 #ifdef USE_WEBKIT_COMPOSITOR |
444 if (!ui::Compositor::compositor_factory()) | 433 if (!ui::Compositor::compositor_factory()) |
445 ui::CompositorCC::Terminate(); | 434 ui::CompositorCC::Terminate(); |
446 #endif | 435 #endif |
447 if (instance_ == this) | 436 if (instance_ == this) |
448 instance_ = NULL; | 437 instance_ = NULL; |
449 } | 438 } |
450 | 439 |
451 void Desktop::HandleMouseMoved(const MouseEvent& event, Window* target) { | 440 void Desktop::HandleMouseMoved(const MouseEvent& event, Window* target) { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 596 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
608 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 597 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
609 } else if (use_fullscreen_host_window_) { | 598 } else if (use_fullscreen_host_window_) { |
610 bounds = gfx::Rect(DesktopHost::GetNativeScreenSize()); | 599 bounds = gfx::Rect(DesktopHost::GetNativeScreenSize()); |
611 } | 600 } |
612 | 601 |
613 return bounds; | 602 return bounds; |
614 } | 603 } |
615 | 604 |
616 } // namespace aura | 605 } // namespace aura |
OLD | NEW |