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

Side by Side Diff: examples/wm_flow/wm/wm.cc

Issue 737913002: Dispatch key events to the currently focused window. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Redo FocusController storage so that it is a local property on a view. Created 6 years, 1 month 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 <vector> 5 #include <vector>
6 6
7 #include "examples/wm_flow/wm/frame_controller.h" 7 #include "examples/wm_flow/wm/frame_controller.h"
8 #include "mojo/application/application_runner_chromium.h" 8 #include "mojo/application/application_runner_chromium.h"
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "mojo/public/cpp/application/application_delegate.h" 10 #include "mojo/public/cpp/application/application_delegate.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 mojo::ServiceProviderImpl* exported_services, 58 mojo::ServiceProviderImpl* exported_services,
59 scoped_ptr<mojo::ServiceProvider> remote_service_provider) override { 59 scoped_ptr<mojo::ServiceProvider> remote_service_provider) override {
60 view_manager_ = view_manager; 60 view_manager_ = view_manager;
61 root_ = root; 61 root_ = root;
62 62
63 window_container_ = mojo::View::Create(view_manager_); 63 window_container_ = mojo::View::Create(view_manager_);
64 window_container_->SetBounds(root_->bounds()); 64 window_container_->SetBounds(root_->bounds());
65 root_->AddChild(window_container_); 65 root_->AddChild(window_container_);
66 66
67 window_manager_app_->InitFocus(scoped_ptr<mojo::FocusRules>( 67 window_manager_app_->InitFocus(scoped_ptr<mojo::FocusRules>(
68 new mojo::BasicFocusRules(window_manager_app_.get(), 68 new mojo::BasicFocusRules(window_container_)));
69 window_container_)));
70 } 69 }
71 virtual void OnViewManagerDisconnected( 70 virtual void OnViewManagerDisconnected(
72 mojo::ViewManager* view_manager) override { 71 mojo::ViewManager* view_manager) override {
73 view_manager_ = NULL; 72 view_manager_ = NULL;
74 root_ = NULL; 73 root_ = NULL;
75 } 74 }
76 75
77 // Overridden from mojo::WindowManagerDelegate: 76 // Overridden from mojo::WindowManagerDelegate:
78 virtual void Embed( 77 virtual void Embed(
79 const mojo::String& url, 78 const mojo::String& url,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 138
140 DISALLOW_COPY_AND_ASSIGN(SimpleWM); 139 DISALLOW_COPY_AND_ASSIGN(SimpleWM);
141 }; 140 };
142 141
143 } // namespace examples 142 } // namespace examples
144 143
145 MojoResult MojoMain(MojoHandle shell_handle) { 144 MojoResult MojoMain(MojoHandle shell_handle) {
146 mojo::ApplicationRunnerChromium runner(new examples::SimpleWM); 145 mojo::ApplicationRunnerChromium runner(new examples::SimpleWM);
147 return runner.Run(shell_handle); 146 return runner.Run(shell_handle);
148 } 147 }
OLDNEW
« no previous file with comments | « examples/window_manager/window_manager.cc ('k') | mojo/services/public/cpp/view_manager/lib/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698