| 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/compositor/compositor.h" | 5 #include "ui/compositor/compositor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 bool IsRunningInMojoShell(base::CommandLine* command_line) { | 48 bool IsRunningInMojoShell(base::CommandLine* command_line) { |
| 49 const char kMojoShellFlag[] = "mojo-platform-channel-handle"; | 49 const char kMojoShellFlag[] = "mojo-platform-channel-handle"; |
| 50 return command_line->HasSwitch(kMojoShellFlag); | 50 return command_line->HasSwitch(kMojoShellFlag); |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace | 53 } // namespace |
| 54 | 54 |
| 55 namespace ui { | 55 namespace ui { |
| 56 | 56 |
| 57 ContextFactory::~ContextFactory() {} |
| 58 |
| 59 void ContextFactory::AddObserver(ContextFactoryObserver* observer) { |
| 60 observer_list_.AddObserver(observer); |
| 61 } |
| 62 |
| 63 void ContextFactory::RemoveObserver(ContextFactoryObserver* observer) { |
| 64 observer_list_.RemoveObserver(observer); |
| 65 } |
| 66 |
| 67 ContextFactory::ContextFactory() {} |
| 68 |
| 57 CompositorLock::CompositorLock(Compositor* compositor) | 69 CompositorLock::CompositorLock(Compositor* compositor) |
| 58 : compositor_(compositor) { | 70 : compositor_(compositor) { |
| 59 if (compositor_->locks_will_time_out_) { | 71 if (compositor_->locks_will_time_out_) { |
| 60 compositor_->task_runner_->PostDelayedTask( | 72 compositor_->task_runner_->PostDelayedTask( |
| 61 FROM_HERE, | 73 FROM_HERE, |
| 62 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), | 74 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), |
| 63 base::TimeDelta::FromMilliseconds(kCompositorLockTimeoutMs)); | 75 base::TimeDelta::FromMilliseconds(kCompositorLockTimeoutMs)); |
| 64 } | 76 } |
| 65 } | 77 } |
| 66 | 78 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 observer_list_, | 510 observer_list_, |
| 499 OnCompositingLockStateChanged(this)); | 511 OnCompositingLockStateChanged(this)); |
| 500 } | 512 } |
| 501 | 513 |
| 502 void Compositor::CancelCompositorLock() { | 514 void Compositor::CancelCompositorLock() { |
| 503 if (compositor_lock_) | 515 if (compositor_lock_) |
| 504 compositor_lock_->CancelLock(); | 516 compositor_lock_->CancelLock(); |
| 505 } | 517 } |
| 506 | 518 |
| 507 } // namespace ui | 519 } // namespace ui |
| OLD | NEW |