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

Side by Side Diff: components/mus/public/cpp/lib/view.cc

Issue 1352043005: mus: Implement Window Server Capture Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test 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 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 "components/mus/public/cpp/view.h" 5 #include "components/mus/public/cpp/view.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 void View::SetImeVisibility(bool visible, mojo::TextInputStatePtr state) { 364 void View::SetImeVisibility(bool visible, mojo::TextInputStatePtr state) {
365 // SetImeVisibility() shouldn't be used if the view is not editable. 365 // SetImeVisibility() shouldn't be used if the view is not editable.
366 DCHECK(state.is_null() || state->type != mojo::TEXT_INPUT_TYPE_NONE); 366 DCHECK(state.is_null() || state->type != mojo::TEXT_INPUT_TYPE_NONE);
367 if (connection_) { 367 if (connection_) {
368 static_cast<ViewTreeClientImpl*>(connection_) 368 static_cast<ViewTreeClientImpl*>(connection_)
369 ->SetImeVisibility(id_, visible, state.Pass()); 369 ->SetImeVisibility(id_, visible, state.Pass());
370 } 370 }
371 } 371 }
372 372
373 void View::SetCapture() {
374 if (connection_)
375 static_cast<ViewTreeClientImpl*>(connection_)->SetCapture(id_);
376 }
377
373 void View::SetFocus() { 378 void View::SetFocus() {
374 if (connection_) 379 if (connection_)
375 static_cast<ViewTreeClientImpl*>(connection_)->SetFocus(id_); 380 static_cast<ViewTreeClientImpl*>(connection_)->SetFocus(id_);
376 } 381 }
377 382
378 bool View::HasFocus() const { 383 bool View::HasFocus() const {
379 return connection_ && connection_->GetFocusedView() == this; 384 return connection_ && connection_->GetFocusedView() == this;
380 } 385 }
381 386
382 void View::Embed(mojo::ViewTreeClientPtr client) { 387 void View::Embed(mojo::ViewTreeClientPtr client) {
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 !static_cast<ViewTreeClientImpl*>(connection_)->is_embed_root()) { 611 !static_cast<ViewTreeClientImpl*>(connection_)->is_embed_root()) {
607 return false; 612 return false;
608 } 613 }
609 614
610 while (!children_.empty()) 615 while (!children_.empty())
611 RemoveChild(children_[0]); 616 RemoveChild(children_[0]);
612 return true; 617 return true;
613 } 618 }
614 619
615 } // namespace mus 620 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698