| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 view_->window_->AddObserver(this); | 453 view_->window_->AddObserver(this); |
| 454 | 454 |
| 455 #if defined(OS_WIN) | 455 #if defined(OS_WIN) |
| 456 if (view_->window_->GetRootWindow()) | 456 if (view_->window_->GetRootWindow()) |
| 457 view_->window_->GetRootWindow()->AddObserver(this); | 457 view_->window_->GetRootWindow()->AddObserver(this); |
| 458 #endif | 458 #endif |
| 459 } | 459 } |
| 460 | 460 |
| 461 virtual ~WindowObserver() { | 461 virtual ~WindowObserver() { |
| 462 view_->window_->RemoveObserver(this); | 462 view_->window_->RemoveObserver(this); |
| 463 if (view_->window_->GetDispatcher()) | 463 if (view_->window_->GetHost()) |
| 464 view_->window_->GetDispatcher()->RemoveRootWindowObserver(this); | 464 view_->window_->GetHost()->dispatcher()->RemoveRootWindowObserver(this); |
| 465 if (parent_) | 465 if (parent_) |
| 466 parent_->RemoveObserver(this); | 466 parent_->RemoveObserver(this); |
| 467 | 467 |
| 468 #if defined(OS_WIN) | 468 #if defined(OS_WIN) |
| 469 if (parent_) { | 469 if (parent_) { |
| 470 const aura::Window::Windows& children = parent_->children(); | 470 const aura::Window::Windows& children = parent_->children(); |
| 471 for (size_t i = 0; i < children.size(); ++i) | 471 for (size_t i = 0; i < children.size(); ++i) |
| 472 children[i]->RemoveObserver(this); | 472 children[i]->RemoveObserver(this); |
| 473 } | 473 } |
| 474 | 474 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 view_->touch_editable_->UpdateEditingController(); | 585 view_->touch_editable_->UpdateEditingController(); |
| 586 #if defined(OS_WIN) | 586 #if defined(OS_WIN) |
| 587 } else { | 587 } else { |
| 588 UpdateConstrainedWindows(NULL); | 588 UpdateConstrainedWindows(NULL); |
| 589 #endif | 589 #endif |
| 590 } | 590 } |
| 591 } | 591 } |
| 592 | 592 |
| 593 virtual void OnWindowAddedToRootWindow(aura::Window* window) OVERRIDE { | 593 virtual void OnWindowAddedToRootWindow(aura::Window* window) OVERRIDE { |
| 594 if (window == view_->window_) { | 594 if (window == view_->window_) { |
| 595 window->GetDispatcher()->AddRootWindowObserver(this); | 595 window->GetHost()->dispatcher()->AddRootWindowObserver(this); |
| 596 #if defined(OS_WIN) | 596 #if defined(OS_WIN) |
| 597 if (!window->GetRootWindow()->HasObserver(this)) | 597 if (!window->GetRootWindow()->HasObserver(this)) |
| 598 window->GetRootWindow()->AddObserver(this); | 598 window->GetRootWindow()->AddObserver(this); |
| 599 #endif | 599 #endif |
| 600 } | 600 } |
| 601 } | 601 } |
| 602 | 602 |
| 603 virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE { | 603 virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE { |
| 604 if (window == view_->window_) { | 604 if (window == view_->window_) { |
| 605 window->GetDispatcher()->RemoveRootWindowObserver(this); | 605 window->GetHost()->dispatcher()->RemoveRootWindowObserver(this); |
| 606 #if defined(OS_WIN) | 606 #if defined(OS_WIN) |
| 607 window->GetRootWindow()->RemoveObserver(this); | 607 window->GetRootWindow()->RemoveObserver(this); |
| 608 | 608 |
| 609 const aura::Window::Windows& root_children = | 609 const aura::Window::Windows& root_children = |
| 610 window->GetRootWindow()->children(); | 610 window->GetRootWindow()->children(); |
| 611 for (size_t i = 0; i < root_children.size(); ++i) { | 611 for (size_t i = 0; i < root_children.size(); ++i) { |
| 612 if (root_children[i] != view_->window_ && root_children[i] != parent_) | 612 if (root_children[i] != view_->window_ && root_children[i] != parent_) |
| 613 root_children[i]->RemoveObserver(this); | 613 root_children[i]->RemoveObserver(this); |
| 614 } | 614 } |
| 615 #endif | 615 #endif |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 event.location(), | 1516 event.location(), |
| 1517 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 1517 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
| 1518 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 1518 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
| 1519 if (drag_dest_delegate_) | 1519 if (drag_dest_delegate_) |
| 1520 drag_dest_delegate_->OnDrop(); | 1520 drag_dest_delegate_->OnDrop(); |
| 1521 current_drop_data_.reset(); | 1521 current_drop_data_.reset(); |
| 1522 return ConvertFromWeb(current_drag_op_); | 1522 return ConvertFromWeb(current_drag_op_); |
| 1523 } | 1523 } |
| 1524 | 1524 |
| 1525 } // namespace content | 1525 } // namespace content |
| OLD | NEW |