Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(868)

Unified Diff: services/ui/public/cpp/scoped_window_ptr.cc

Issue 2651593002: mus: Remove the old client lib. (Closed)
Patch Set: restore test Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/public/cpp/scoped_window_ptr.h ('k') | services/ui/public/cpp/tests/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/public/cpp/scoped_window_ptr.cc
diff --git a/services/ui/public/cpp/scoped_window_ptr.cc b/services/ui/public/cpp/scoped_window_ptr.cc
deleted file mode 100644
index 74ab60ea2df96eadb06ab1406873e6b8ecfff06a..0000000000000000000000000000000000000000
--- a/services/ui/public/cpp/scoped_window_ptr.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "services/ui/public/cpp/scoped_window_ptr.h"
-
-#include "services/ui/public/cpp/window.h"
-#include "services/ui/public/cpp/window_observer.h"
-#include "services/ui/public/cpp/window_tree_client.h"
-
-namespace ui {
-
-ScopedWindowPtr::ScopedWindowPtr(Window* window) : window_(window) {
- window_->AddObserver(this);
-}
-
-ScopedWindowPtr::~ScopedWindowPtr() {
- if (window_)
- DeleteWindowOrWindowManager(window_);
- DetachFromWindow();
-}
-
-// static
-void ScopedWindowPtr::DeleteWindowOrWindowManager(Window* window) {
- if (window->window_tree()->GetRoots().count(window) > 0)
- delete window->window_tree();
- else
- window->Destroy();
-}
-
-void ScopedWindowPtr::DetachFromWindow() {
- if (!window_)
- return;
-
- window_->RemoveObserver(this);
- window_ = nullptr;
-}
-
-void ScopedWindowPtr::OnWindowDestroying(Window* window) {
- DCHECK_EQ(window_, window);
- DetachFromWindow();
-}
-
-} // namespace ui
« no previous file with comments | « services/ui/public/cpp/scoped_window_ptr.h ('k') | services/ui/public/cpp/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698