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