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/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 web_contents_->GetRenderViewHost()->DragTargetDrop( | 1571 web_contents_->GetRenderViewHost()->DragTargetDrop( |
1572 event.location(), | 1572 event.location(), |
1573 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 1573 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
1574 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 1574 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
1575 if (drag_dest_delegate_) | 1575 if (drag_dest_delegate_) |
1576 drag_dest_delegate_->OnDrop(); | 1576 drag_dest_delegate_->OnDrop(); |
1577 current_drop_data_.reset(); | 1577 current_drop_data_.reset(); |
1578 return ConvertFromWeb(current_drag_op_); | 1578 return ConvertFromWeb(current_drag_op_); |
1579 } | 1579 } |
1580 | 1580 |
1581 void WebContentsViewAura::OnWindowParentChanged(aura::Window* window, | |
1582 aura::Window* parent) { | |
1583 // Ignore any visibility changes in the hierarchy below. | |
1584 if (window != window_.get() && window_->Contains(window)) | |
1585 return; | |
1586 | |
1587 // On Windows we will get called with a parent of NULL as part of the shut | |
1588 // down process. As such we do only change the visibility when a parent gets | |
1589 // set. | |
1590 if (parent) | |
1591 UpdateWebContentsVisibility(window->IsVisible()); | |
1592 } | |
1593 | |
1594 void WebContentsViewAura::OnWindowVisibilityChanged(aura::Window* window, | 1581 void WebContentsViewAura::OnWindowVisibilityChanged(aura::Window* window, |
1595 bool visible) { | 1582 bool visible) { |
1596 // Ignore any visibility changes in the hierarchy below. | 1583 // Ignore any visibility changes in the hierarchy below. |
1597 if (window != window_.get() && window_->Contains(window)) | 1584 if (window != window_.get() && window_->Contains(window)) |
1598 return; | 1585 return; |
1599 | 1586 |
1600 UpdateWebContentsVisibility(visible); | 1587 UpdateWebContentsVisibility(visible); |
1601 } | 1588 } |
1602 | 1589 |
1603 void WebContentsViewAura::UpdateWebContentsVisibility(bool visible) { | 1590 void WebContentsViewAura::UpdateWebContentsVisibility(bool visible) { |
(...skipping 13 matching lines...) Expand all Loading... |
1617 if (visible) { | 1604 if (visible) { |
1618 if (!web_contents_->should_normally_be_visible()) | 1605 if (!web_contents_->should_normally_be_visible()) |
1619 web_contents_->WasShown(); | 1606 web_contents_->WasShown(); |
1620 } else { | 1607 } else { |
1621 if (web_contents_->should_normally_be_visible()) | 1608 if (web_contents_->should_normally_be_visible()) |
1622 web_contents_->WasHidden(); | 1609 web_contents_->WasHidden(); |
1623 } | 1610 } |
1624 } | 1611 } |
1625 | 1612 |
1626 } // namespace content | 1613 } // namespace content |
OLD | NEW |