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

Unified Diff: components/mus/public/cpp/lib/scoped_window_ptr.cc

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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 | « components/mus/public/cpp/lib/property_type_converters.cc ('k') | components/mus/public/cpp/lib/window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/lib/scoped_window_ptr.cc
diff --git a/components/mus/public/cpp/lib/scoped_window_ptr.cc b/components/mus/public/cpp/lib/scoped_window_ptr.cc
deleted file mode 100644
index 360da1ff4b591f34077325572f0e195d1541814d..0000000000000000000000000000000000000000
--- a/components/mus/public/cpp/lib/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 "components/mus/public/cpp/scoped_window_ptr.h"
-
-#include "components/mus/public/cpp/window.h"
-#include "components/mus/public/cpp/window_observer.h"
-#include "components/mus/public/cpp/window_tree_client.h"
-
-namespace mus {
-
-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 mus
« no previous file with comments | « components/mus/public/cpp/lib/property_type_converters.cc ('k') | components/mus/public/cpp/lib/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698