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

Side by Side Diff: mojo/services/view_manager/server_view.cc

Issue 599213002: First cut at supporting activation in the window manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/services/view_manager/server_view.h" 5 #include "mojo/services/view_manager/server_view.h"
6 6
7 #include "mojo/services/view_manager/server_view_delegate.h" 7 #include "mojo/services/view_manager/server_view_delegate.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 namespace service { 10 namespace service {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 DCHECK_GT(children_.size(), 1u); 66 DCHECK_GT(children_.size(), 1u);
67 children_.erase(std::find(children_.begin(), children_.end(), child)); 67 children_.erase(std::find(children_.begin(), children_.end(), child));
68 Views::iterator i = std::find(children_.begin(), children_.end(), relative); 68 Views::iterator i = std::find(children_.begin(), children_.end(), relative);
69 if (direction == ORDER_DIRECTION_ABOVE) { 69 if (direction == ORDER_DIRECTION_ABOVE) {
70 DCHECK(i != children_.end()); 70 DCHECK(i != children_.end());
71 children_.insert(++i, child); 71 children_.insert(++i, child);
72 } else if (direction == ORDER_DIRECTION_BELOW) { 72 } else if (direction == ORDER_DIRECTION_BELOW) {
73 DCHECK(i != children_.end()); 73 DCHECK(i != children_.end());
74 children_.insert(i, child); 74 children_.insert(i, child);
75 } 75 }
76 delegate_->OnViewReordered(this, relative, direction);
76 } 77 }
77 78
78 void ServerView::SetBounds(const gfx::Rect& bounds) { 79 void ServerView::SetBounds(const gfx::Rect& bounds) {
79 if (bounds_ == bounds) 80 if (bounds_ == bounds)
80 return; 81 return;
81 82
82 const gfx::Rect old_bounds = bounds_; 83 const gfx::Rect old_bounds = bounds_;
83 bounds_ = bounds; 84 bounds_ = bounds;
84 delegate_->OnViewBoundsChanged(this, old_bounds, bounds); 85 delegate_->OnViewBoundsChanged(this, old_bounds, bounds);
85 } 86 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 delegate_->OnViewSurfaceIdChanged(this); 135 delegate_->OnViewSurfaceIdChanged(this);
135 } 136 }
136 137
137 void ServerView::RemoveImpl(ServerView* view) { 138 void ServerView::RemoveImpl(ServerView* view) {
138 view->parent_ = NULL; 139 view->parent_ = NULL;
139 children_.erase(std::find(children_.begin(), children_.end(), view)); 140 children_.erase(std::find(children_.begin(), children_.end(), view));
140 } 141 }
141 142
142 } // namespace service 143 } // namespace service
143 } // namespace mojo 144 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698