| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ozone/platform/dri/native_display_delegate_proxy.h" | 5 #include "ui/ozone/platform/dri/native_display_delegate_proxy.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 // Just read it on current thread as this is necessary information | 100 // Just read it on current thread as this is necessary information |
| 101 // to start. This access only tmpfs, which is fast. | 101 // to start. This access only tmpfs, which is fast. |
| 102 // TODO(dnicoara|oshima): crbug.com/450886. | 102 // TODO(dnicoara|oshima): crbug.com/450886. |
| 103 base::ThreadRestrictions::ScopedAllowIO allow_io; | 103 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 104 success = CreateSnapshotFromEDIDFile(kEDIDFile, ¶ms); | 104 success = CreateSnapshotFromEDIDFile(kEDIDFile, ¶ms); |
| 105 } | 105 } |
| 106 | 106 |
| 107 // Fallback to command line if the file doesn't exit or failed to read. | 107 // Fallback to command line if the file doesn't exit or failed to read. |
| 108 if (success || CreateSnapshotFromCommandLine(¶ms)) { | 108 if (success || CreateSnapshotFromCommandLine(¶ms)) { |
| 109 LOG_IF(ERROR, !success) << "Failed to read display_info.bin."; |
| 109 DCHECK_NE(DISPLAY_CONNECTION_TYPE_NONE, params.type); | 110 DCHECK_NE(DISPLAY_CONNECTION_TYPE_NONE, params.type); |
| 110 displays_.push_back(new DriDisplaySnapshotProxy(params, display_manager_)); | 111 displays_.push_back(new DriDisplaySnapshotProxy(params, display_manager_)); |
| 111 has_dummy_display_ = true; | 112 has_dummy_display_ = true; |
| 113 } else { |
| 114 LOG(ERROR) << "Failed to obtain initial display info"; |
| 112 } | 115 } |
| 113 } | 116 } |
| 114 | 117 |
| 115 void NativeDisplayDelegateProxy::GrabServer() { | 118 void NativeDisplayDelegateProxy::GrabServer() { |
| 116 } | 119 } |
| 117 | 120 |
| 118 void NativeDisplayDelegateProxy::UngrabServer() { | 121 void NativeDisplayDelegateProxy::UngrabServer() { |
| 119 } | 122 } |
| 120 | 123 |
| 121 bool NativeDisplayDelegateProxy::TakeDisplayControl() { | 124 bool NativeDisplayDelegateProxy::TakeDisplayControl() { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 void NativeDisplayDelegateProxy::OnDisplayConfigured(int64_t display_id, | 323 void NativeDisplayDelegateProxy::OnDisplayConfigured(int64_t display_id, |
| 321 bool status) { | 324 bool status) { |
| 322 auto it = configure_callback_map_.find(display_id); | 325 auto it = configure_callback_map_.find(display_id); |
| 323 if (it != configure_callback_map_.end()) { | 326 if (it != configure_callback_map_.end()) { |
| 324 it->second.Run(status); | 327 it->second.Run(status); |
| 325 configure_callback_map_.erase(it); | 328 configure_callback_map_.erase(it); |
| 326 } | 329 } |
| 327 } | 330 } |
| 328 | 331 |
| 329 } // namespace ui | 332 } // namespace ui |
| OLD | NEW |