| 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 "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 &origin); | 172 &origin); |
| 173 | 173 |
| 174 return base::MakeUnique<ShellSurface>( | 174 return base::MakeUnique<ShellSurface>( |
| 175 surface, parent, ShellSurface::BoundsMode::FIXED, origin, | 175 surface, parent, ShellSurface::BoundsMode::FIXED, origin, |
| 176 false /* activatable */, false /* can_minimize */, | 176 false /* activatable */, false /* can_minimize */, |
| 177 ash::kShellWindowId_DefaultContainer); | 177 ash::kShellWindowId_DefaultContainer); |
| 178 } | 178 } |
| 179 | 179 |
| 180 std::unique_ptr<ShellSurface> Display::CreateRemoteShellSurface( | 180 std::unique_ptr<ShellSurface> Display::CreateRemoteShellSurface( |
| 181 Surface* surface, | 181 Surface* surface, |
| 182 const gfx::Point& origin, |
| 182 int container) { | 183 int container) { |
| 183 TRACE_EVENT2("exo", "Display::CreateRemoteShellSurface", "surface", | 184 TRACE_EVENT2("exo", "Display::CreateRemoteShellSurface", "surface", |
| 184 surface->AsTracedValue(), "container", container); | 185 surface->AsTracedValue(), "container", container); |
| 185 | 186 |
| 186 if (surface->HasSurfaceDelegate()) { | 187 if (surface->HasSurfaceDelegate()) { |
| 187 DLOG(ERROR) << "Surface has already been assigned a role"; | 188 DLOG(ERROR) << "Surface has already been assigned a role"; |
| 188 return nullptr; | 189 return nullptr; |
| 189 } | 190 } |
| 190 | 191 |
| 191 // Remote shell surfaces in system modal container cannot be minimized. | 192 // Remote shell surfaces in system modal container cannot be minimized. |
| 192 bool can_minimize = container != ash::kShellWindowId_SystemModalContainer; | 193 bool can_minimize = container != ash::kShellWindowId_SystemModalContainer; |
| 193 | 194 |
| 194 return base::MakeUnique<ShellSurface>( | 195 return base::MakeUnique<ShellSurface>( |
| 195 surface, nullptr, ShellSurface::BoundsMode::CLIENT, gfx::Point(), | 196 surface, nullptr, ShellSurface::BoundsMode::CLIENT, origin, |
| 196 true /* activatable */, can_minimize, container); | 197 true /* activatable */, can_minimize, container); |
| 197 } | 198 } |
| 198 | 199 |
| 199 std::unique_ptr<SubSurface> Display::CreateSubSurface(Surface* surface, | 200 std::unique_ptr<SubSurface> Display::CreateSubSurface(Surface* surface, |
| 200 Surface* parent) { | 201 Surface* parent) { |
| 201 TRACE_EVENT2("exo", "Display::CreateSubSurface", "surface", | 202 TRACE_EVENT2("exo", "Display::CreateSubSurface", "surface", |
| 202 surface->AsTracedValue(), "parent", parent->AsTracedValue()); | 203 surface->AsTracedValue(), "parent", parent->AsTracedValue()); |
| 203 | 204 |
| 204 if (surface->window()->Contains(parent->window())) { | 205 if (surface->window()->Contains(parent->window())) { |
| 205 DLOG(ERROR) << "Parent is contained within surface's hierarchy"; | 206 DLOG(ERROR) << "Parent is contained within surface's hierarchy"; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 224 notification_surface_manager_->GetSurface(notification_id)) { | 225 notification_surface_manager_->GetSurface(notification_id)) { |
| 225 DLOG(ERROR) << "Invalid notification id, id=" << notification_id; | 226 DLOG(ERROR) << "Invalid notification id, id=" << notification_id; |
| 226 return nullptr; | 227 return nullptr; |
| 227 } | 228 } |
| 228 | 229 |
| 229 return base::MakeUnique<NotificationSurface>(notification_surface_manager_, | 230 return base::MakeUnique<NotificationSurface>(notification_surface_manager_, |
| 230 surface, notification_id); | 231 surface, notification_id); |
| 231 } | 232 } |
| 232 | 233 |
| 233 } // namespace exo | 234 } // namespace exo |
| OLD | NEW |