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 "components/exo/display.h" | 5 #include "components/exo/display.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 scoped_ptr<ShellSurface> Display::CreateShellSurface(Surface* surface) { | 93 scoped_ptr<ShellSurface> Display::CreateShellSurface(Surface* surface) { |
94 TRACE_EVENT1("exo", "Display::CreateShellSurface", "surface", | 94 TRACE_EVENT1("exo", "Display::CreateShellSurface", "surface", |
95 surface->AsTracedValue()); | 95 surface->AsTracedValue()); |
96 | 96 |
97 if (surface->HasSurfaceDelegate()) { | 97 if (surface->HasSurfaceDelegate()) { |
98 DLOG(ERROR) << "Surface has already been assigned a role"; | 98 DLOG(ERROR) << "Surface has already been assigned a role"; |
99 return nullptr; | 99 return nullptr; |
100 } | 100 } |
101 | 101 |
102 return make_scoped_ptr(new ShellSurface(surface, nullptr, gfx::Rect())); | 102 return make_scoped_ptr(new ShellSurface(surface, nullptr, gfx::Rect(), true)); |
103 } | 103 } |
104 | 104 |
105 scoped_ptr<ShellSurface> Display::CreatePopupShellSurface( | 105 scoped_ptr<ShellSurface> Display::CreatePopupShellSurface( |
106 Surface* surface, | 106 Surface* surface, |
107 ShellSurface* parent, | 107 ShellSurface* parent, |
108 const gfx::Point& position) { | 108 const gfx::Point& position) { |
109 TRACE_EVENT2("exo", "Display::CreatePopupShellSurface", "surface", | 109 TRACE_EVENT2("exo", "Display::CreatePopupShellSurface", "surface", |
110 surface->AsTracedValue(), "parent", parent->AsTracedValue()); | 110 surface->AsTracedValue(), "parent", parent->AsTracedValue()); |
111 | 111 |
112 if (surface->Contains(parent->GetWidget()->GetNativeWindow())) { | 112 if (surface->Contains(parent->GetWidget()->GetNativeWindow())) { |
113 DLOG(ERROR) << "Parent is contained within surface's hierarchy"; | 113 DLOG(ERROR) << "Parent is contained within surface's hierarchy"; |
114 return nullptr; | 114 return nullptr; |
115 } | 115 } |
116 | 116 |
117 if (surface->HasSurfaceDelegate()) { | 117 if (surface->HasSurfaceDelegate()) { |
118 DLOG(ERROR) << "Surface has already been assigned a role"; | 118 DLOG(ERROR) << "Surface has already been assigned a role"; |
119 return nullptr; | 119 return nullptr; |
120 } | 120 } |
121 | 121 |
122 return make_scoped_ptr( | 122 return make_scoped_ptr(new ShellSurface( |
123 new ShellSurface(surface, parent, gfx::Rect(position, gfx::Size(1, 1)))); | 123 surface, parent, gfx::Rect(position, gfx::Size(1, 1)), false)); |
124 } | 124 } |
125 | 125 |
126 scoped_ptr<SubSurface> Display::CreateSubSurface(Surface* surface, | 126 scoped_ptr<SubSurface> Display::CreateSubSurface(Surface* surface, |
127 Surface* parent) { | 127 Surface* parent) { |
128 TRACE_EVENT2("exo", "Display::CreateSubSurface", "surface", | 128 TRACE_EVENT2("exo", "Display::CreateSubSurface", "surface", |
129 surface->AsTracedValue(), "parent", parent->AsTracedValue()); | 129 surface->AsTracedValue(), "parent", parent->AsTracedValue()); |
130 | 130 |
131 if (surface->Contains(parent)) { | 131 if (surface->Contains(parent)) { |
132 DLOG(ERROR) << "Parent is contained within surface's hierarchy"; | 132 DLOG(ERROR) << "Parent is contained within surface's hierarchy"; |
133 return nullptr; | 133 return nullptr; |
134 } | 134 } |
135 | 135 |
136 if (surface->HasSurfaceDelegate()) { | 136 if (surface->HasSurfaceDelegate()) { |
137 DLOG(ERROR) << "Surface has already been assigned a role"; | 137 DLOG(ERROR) << "Surface has already been assigned a role"; |
138 return nullptr; | 138 return nullptr; |
139 } | 139 } |
140 | 140 |
141 return make_scoped_ptr(new SubSurface(surface, parent)); | 141 return make_scoped_ptr(new SubSurface(surface, parent)); |
142 } | 142 } |
143 | 143 |
144 } // namespace exo | 144 } // namespace exo |
OLD | NEW |