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

Side by Side Diff: examples/window_manager/window_manager.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
« no previous file with comments | « no previous file | examples/wm_flow/wm/wm.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/bind.h" 5 #include "base/bind.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "examples/keyboard/keyboard.mojom.h" 7 #include "examples/keyboard/keyboard.mojom.h"
8 #include "examples/window_manager/debug_panel.h" 8 #include "examples/window_manager/debug_panel.h"
9 #include "examples/window_manager/window_manager.mojom.h" 9 #include "examples/window_manager/window_manager.mojom.h"
10 #include "mojo/application/application_runner_chromium.h" 10 #include "mojo/application/application_runner_chromium.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 new RootLayoutManager(view_manager, root, 369 new RootLayoutManager(view_manager, root,
370 content_view_id_, 370 content_view_id_,
371 launcher_ui_id, 371 launcher_ui_id,
372 control_panel_id)); 372 control_panel_id));
373 root->AddObserver(root_layout_manager_.get()); 373 root->AddObserver(root_layout_manager_.get());
374 374
375 // TODO(erg): In the aura version, we explicitly added ourselves as a 375 // TODO(erg): In the aura version, we explicitly added ourselves as a
376 // PreTargetHandler to the window() here. We probably have to do something 376 // PreTargetHandler to the window() here. We probably have to do something
377 // analogous here. 377 // analogous here.
378 378
379 window_manager_app_->InitFocus(scoped_ptr<mojo::FocusRules>( 379 window_manager_app_->InitFocus(
380 new mojo::BasicFocusRules(window_manager_app_.get(), 380 scoped_ptr<mojo::FocusRules>(new mojo::BasicFocusRules(view)));
381 view)));
382 } 381 }
383 virtual void OnViewManagerDisconnected(ViewManager* view_manager) override { 382 virtual void OnViewManagerDisconnected(ViewManager* view_manager) override {
384 DCHECK_EQ(view_manager_, view_manager); 383 DCHECK_EQ(view_manager_, view_manager);
385 view_manager_ = NULL; 384 view_manager_ = NULL;
386 base::MessageLoop::current()->Quit(); 385 base::MessageLoop::current()->Quit();
387 } 386 }
388 387
389 // Overridden from WindowManagerDelegate: 388 // Overridden from WindowManagerDelegate:
390 virtual void Embed( 389 virtual void Embed(
391 const String& url, 390 const String& url,
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 window_manager_->RequestNavigate(view_id_, target, request.Pass()); 546 window_manager_->RequestNavigate(view_id_, target, request.Pass());
548 } 547 }
549 548
550 } // namespace examples 549 } // namespace examples
551 } // namespace mojo 550 } // namespace mojo
552 551
553 MojoResult MojoMain(MojoHandle shell_handle) { 552 MojoResult MojoMain(MojoHandle shell_handle) {
554 mojo::ApplicationRunnerChromium runner(new mojo::examples::WindowManager); 553 mojo::ApplicationRunnerChromium runner(new mojo::examples::WindowManager);
555 return runner.Run(shell_handle); 554 return runner.Run(shell_handle);
556 } 555 }
OLDNEW
« no previous file with comments | « no previous file | examples/wm_flow/wm/wm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698