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

Unified Diff: components/view_manager/public/cpp/lib/scoped_view_ptr.cc

Issue 1344573002: Mandoline: Rename components/view_manager to components/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 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/view_manager/public/cpp/lib/args.cc ('k') | components/view_manager/public/cpp/lib/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/view_manager/public/cpp/lib/scoped_view_ptr.cc
diff --git a/components/view_manager/public/cpp/lib/scoped_view_ptr.cc b/components/view_manager/public/cpp/lib/scoped_view_ptr.cc
deleted file mode 100644
index 93e231ab7a94f3438e48a75a36c39addf672ae80..0000000000000000000000000000000000000000
--- a/components/view_manager/public/cpp/lib/scoped_view_ptr.cc
+++ /dev/null
@@ -1,45 +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/view_manager/public/cpp/scoped_view_ptr.h"
-
-#include "components/view_manager/public/cpp/view.h"
-#include "components/view_manager/public/cpp/view_observer.h"
-#include "components/view_manager/public/cpp/view_tree_connection.h"
-
-namespace mojo {
-
-ScopedViewPtr::ScopedViewPtr(View* view)
- : view_(view) {
- view_->AddObserver(this);
-}
-
-ScopedViewPtr::~ScopedViewPtr() {
- if (view_)
- DeleteViewOrViewManager(view_);
- DetachFromView();
-}
-
-// static
-void ScopedViewPtr::DeleteViewOrViewManager(View* view) {
- if (view->connection()->GetRoot() == view)
- delete view->connection();
- else
- view->Destroy();
-}
-
-void ScopedViewPtr::DetachFromView() {
- if (!view_)
- return;
-
- view_->RemoveObserver(this);
- view_ = nullptr;
-}
-
-void ScopedViewPtr::OnViewDestroying(View* view) {
- DCHECK_EQ(view_, view);
- DetachFromView();
-}
-
-} // namespace mojo
« no previous file with comments | « components/view_manager/public/cpp/lib/args.cc ('k') | components/view_manager/public/cpp/lib/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698