OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/aura/desktop.h" | 5 #include "ui/aura/desktop.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
461 return false; | 461 return false; |
462 | 462 |
463 EventFilters filters; | 463 EventFilters filters; |
464 GetEventFiltersToNotify(target, &filters); | 464 GetEventFiltersToNotify(target, &filters); |
465 for (EventFilters::const_reverse_iterator it = filters.rbegin(); | 465 for (EventFilters::const_reverse_iterator it = filters.rbegin(); |
466 it != filters.rend(); ++it) { | 466 it != filters.rend(); ++it) { |
467 if ((*it)->PreHandleMouseEvent(target, event)) | 467 if ((*it)->PreHandleMouseEvent(target, event)) |
468 return true; | 468 return true; |
469 } | 469 } |
470 | 470 |
471 return target->delegate()->OnMouseEvent(event); | 471 bool handled = false; |
472 for (Window* window = target; !handled && window; window = window->parent()) { | |
Ben Goodger (Google)
2011/12/08 19:10:26
So, after discovering how this feature is implemen
| |
473 if (window->delegate()) | |
474 handled = window->delegate()->OnMouseEvent(event); | |
475 } | |
476 | |
477 return handled; | |
472 } | 478 } |
473 | 479 |
474 bool Desktop::ProcessKeyEvent(Window* target, KeyEvent* event) { | 480 bool Desktop::ProcessKeyEvent(Window* target, KeyEvent* event) { |
475 if (!target->IsVisible()) | 481 if (!target->IsVisible()) |
476 return false; | 482 return false; |
477 | 483 |
478 EventFilters filters; | 484 EventFilters filters; |
479 GetEventFiltersToNotify(target, &filters); | 485 GetEventFiltersToNotify(target, &filters); |
480 for (EventFilters::const_reverse_iterator it = filters.rbegin(); | 486 for (EventFilters::const_reverse_iterator it = filters.rbegin(); |
481 it != filters.rend(); ++it) { | 487 it != filters.rend(); ++it) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
599 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 605 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
600 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 606 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
601 } else if (use_fullscreen_host_window_) { | 607 } else if (use_fullscreen_host_window_) { |
602 bounds = gfx::Rect(DesktopHost::GetNativeScreenSize()); | 608 bounds = gfx::Rect(DesktopHost::GetNativeScreenSize()); |
603 } | 609 } |
604 | 610 |
605 return bounds; | 611 return bounds; |
606 } | 612 } |
607 | 613 |
608 } // namespace aura | 614 } // namespace aura |
OLD | NEW |