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

Side by Side Diff: mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc

Issue 405523002: Add ability APIs for opening a window with a url embedded, focusing and activating a window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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 | Annotate | Revision Log
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/public/cpp/view_manager/lib/view_manager_client_impl.h" 5 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "mojo/public/cpp/application/application_connection.h" 9 #include "mojo/public/cpp/application/application_connection.h"
10 #include "mojo/public/cpp/application/connect.h" 10 #include "mojo/public/cpp/application/connect.h"
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 ViewManagerClientImpl::ViewManagerClientImpl(ApplicationConnection* connection, 526 ViewManagerClientImpl::ViewManagerClientImpl(ApplicationConnection* connection,
527 ViewManagerDelegate* delegate) 527 ViewManagerDelegate* delegate)
528 : connected_(false), 528 : connected_(false),
529 connection_id_(0), 529 connection_id_(0),
530 next_id_(1), 530 next_id_(1),
531 delegate_(delegate), 531 delegate_(delegate),
532 dispatcher_(NULL) {} 532 dispatcher_(NULL) {}
533 533
534 ViewManagerClientImpl::~ViewManagerClientImpl() { 534 ViewManagerClientImpl::~ViewManagerClientImpl() {
535 delegate_->OnViewManagerDisconnected(this);
536 while (!nodes_.empty()) { 535 while (!nodes_.empty()) {
537 IdToNodeMap::iterator it = nodes_.begin(); 536 IdToNodeMap::iterator it = nodes_.begin();
538 if (OwnsNode(it->second->id())) 537 if (OwnsNode(it->second->id()))
539 it->second->Destroy(); 538 it->second->Destroy();
540 else 539 else
541 nodes_.erase(it); 540 nodes_.erase(it);
542 } 541 }
543 while (!views_.empty()) { 542 while (!views_.empty()) {
544 IdToViewMap::iterator it = views_.begin(); 543 IdToViewMap::iterator it = views_.begin();
545 if (OwnsView(it->second->id())) 544 if (OwnsView(it->second->id()))
546 it->second->Destroy(); 545 it->second->Destroy();
547 else 546 else
548 views_.erase(it); 547 views_.erase(it);
549 } 548 }
549 delegate_->OnViewManagerDisconnected(this);
550 } 550 }
551 551
552 Id ViewManagerClientImpl::CreateNode() { 552 Id ViewManagerClientImpl::CreateNode() {
553 DCHECK(connected_); 553 DCHECK(connected_);
554 const Id node_id(MakeTransportId(connection_id_, ++next_id_)); 554 const Id node_id(MakeTransportId(connection_id_, ++next_id_));
555 pending_transactions_.push_back(new CreateNodeTransaction(node_id, this)); 555 pending_transactions_.push_back(new CreateNodeTransaction(node_id, this));
556 Sync(); 556 Sync();
557 return node_id; 557 return node_id;
558 } 558 }
559 559
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 878
879 // static 879 // static
880 void ViewManager::ConfigureIncomingConnection( 880 void ViewManager::ConfigureIncomingConnection(
881 ApplicationConnection* connection, 881 ApplicationConnection* connection,
882 ViewManagerDelegate* delegate) { 882 ViewManagerDelegate* delegate) {
883 connection->AddService<ViewManagerClientImpl>(delegate); 883 connection->AddService<ViewManagerClientImpl>(delegate);
884 } 884 }
885 885
886 } // namespace view_manager 886 } // namespace view_manager
887 } // namespace mojo 887 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/mojo_services.gypi ('k') | mojo/services/public/interfaces/window_manager/window_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698