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

Side by Side Diff: mojo/examples/window_manager/window_manager.cc

Issue 405653003: mojo: Make InterfacePtr<> testable in if() statements without .get(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "mojo/examples/keyboard/keyboard.mojom.h" 7 #include "mojo/examples/keyboard/keyboard.mojom.h"
8 #include "mojo/examples/window_manager/debug_panel.h" 8 #include "mojo/examples/window_manager/debug_panel.h"
9 #include "mojo/examples/window_manager/window_manager.mojom.h" 9 #include "mojo/examples/window_manager/window_manager.mojom.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 embedded->SetBounds(bounds); 457 embedded->SetBounds(bounds);
458 Embed(embedded, url, nav_details.Pass(), response.Pass()); 458 Embed(embedded, url, nav_details.Pass(), response.Pass());
459 embedded->SetFocus(); 459 embedded->SetFocus();
460 return embedded; 460 return embedded;
461 } 461 }
462 462
463 void Embed(Node* node, const std::string& app_url, 463 void Embed(Node* node, const std::string& app_url,
464 navigation::NavigationDetailsPtr nav_details, 464 navigation::NavigationDetailsPtr nav_details,
465 navigation::ResponseDetailsPtr response) { 465 navigation::ResponseDetailsPtr response) {
466 node->Embed(app_url); 466 node->Embed(app_url);
467 if (nav_details.get()) { 467 if (nav_details) {
468 navigation::NavigatorPtr navigator; 468 navigation::NavigatorPtr navigator;
469 app_->ConnectToService(app_url, &navigator); 469 app_->ConnectToService(app_url, &navigator);
470 navigator->Navigate(node->id(), nav_details.Pass(), response.Pass()); 470 navigator->Navigate(node->id(), nav_details.Pass(), response.Pass());
471 } 471 }
472 } 472 }
473 473
474 bool IsDescendantOfKeyboard(View* target) { 474 bool IsDescendantOfKeyboard(View* target) {
475 return keyboard_manager_.get() && 475 return keyboard_manager_.get() &&
476 keyboard_manager_->node()->Contains(target->node()); 476 keyboard_manager_->node()->Contains(target->node());
477 } 477 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 } 536 }
537 537
538 } // namespace examples 538 } // namespace examples
539 539
540 // static 540 // static
541 ApplicationDelegate* ApplicationDelegate::Create() { 541 ApplicationDelegate* ApplicationDelegate::Create() {
542 return new examples::WindowManager; 542 return new examples::WindowManager;
543 } 543 }
544 544
545 } // namespace mojo 545 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698