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

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

Issue 418983002: Nukes view_manager namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resolve merge Created 6 years, 4 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
« no previous file with comments | « mojo/examples/window_manager/debug_panel.cc ('k') | mojo/examples/wm_flow/app/app.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 14 matching lines...) Expand all
25 #include "mojo/services/public/interfaces/navigation/navigation.mojom.h" 25 #include "mojo/services/public/interfaces/navigation/navigation.mojom.h"
26 #include "mojo/views/views_init.h" 26 #include "mojo/views/views_init.h"
27 #include "ui/events/event.h" 27 #include "ui/events/event.h"
28 #include "ui/events/event_constants.h" 28 #include "ui/events/event_constants.h"
29 #include "ui/gfx/geometry/size_conversions.h" 29 #include "ui/gfx/geometry/size_conversions.h"
30 30
31 #if defined CreateWindow 31 #if defined CreateWindow
32 #undef CreateWindow 32 #undef CreateWindow
33 #endif 33 #endif
34 34
35 using mojo::view_manager::Id;
36 using mojo::view_manager::Node;
37 using mojo::view_manager::NodeObserver;
38 using mojo::view_manager::View;
39 using mojo::view_manager::ViewManager;
40 using mojo::view_manager::ViewManagerClientFactory;
41 using mojo::view_manager::ViewManagerDelegate;
42 using mojo::view_manager::ViewObserver;
43 using mojo::view_manager::WindowManagerDelegate;
44
45 namespace mojo { 35 namespace mojo {
46 namespace examples { 36 namespace examples {
47 37
48 class WindowManager; 38 class WindowManager;
49 39
50 namespace { 40 namespace {
51 41
52 const int kBorderInset = 25; 42 const int kBorderInset = 25;
53 const int kControlPanelWidth = 200; 43 const int kControlPanelWidth = 200;
54 const int kTextfieldHeight = 25; 44 const int kTextfieldHeight = 25;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 app_->ConnectToService(app_url, &navigator); 471 app_->ConnectToService(app_url, &navigator);
482 navigator->Navigate(node->id(), nav_details.Pass(), response.Pass()); 472 navigator->Navigate(node->id(), nav_details.Pass(), response.Pass());
483 } 473 }
484 } 474 }
485 475
486 bool IsDescendantOfKeyboard(View* target) { 476 bool IsDescendantOfKeyboard(View* target) {
487 return keyboard_manager_.get() && 477 return keyboard_manager_.get() &&
488 keyboard_manager_->node()->Contains(target->node()); 478 keyboard_manager_->node()->Contains(target->node());
489 } 479 }
490 480
491 Id CreateControlPanel(view_manager::Node* root) { 481 Id CreateControlPanel(Node* root) {
492 Node* node = Node::Create(view_manager_); 482 Node* node = Node::Create(view_manager_);
493 View* view = view_manager::View::Create(view_manager_); 483 View* view = View::Create(view_manager_);
494 root->AddChild(node); 484 root->AddChild(node);
495 node->SetActiveView(view); 485 node->SetActiveView(view);
496 486
497 gfx::Rect bounds(root->bounds().width() - kControlPanelWidth - 487 gfx::Rect bounds(root->bounds().width() - kControlPanelWidth -
498 kBorderInset, 488 kBorderInset,
499 kBorderInset * 2 + kTextfieldHeight, 489 kBorderInset * 2 + kTextfieldHeight,
500 kControlPanelWidth, 490 kControlPanelWidth,
501 root->bounds().height() - kBorderInset * 3 - 491 root->bounds().height() - kBorderInset * 3 -
502 kTextfieldHeight); 492 kTextfieldHeight);
503 node->SetBounds(bounds); 493 node->SetBounds(bounds);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 } 539 }
550 540
551 } // namespace examples 541 } // namespace examples
552 542
553 // static 543 // static
554 ApplicationDelegate* ApplicationDelegate::Create() { 544 ApplicationDelegate* ApplicationDelegate::Create() {
555 return new examples::WindowManager; 545 return new examples::WindowManager;
556 } 546 }
557 547
558 } // namespace mojo 548 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/window_manager/debug_panel.cc ('k') | mojo/examples/wm_flow/app/app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698