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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 564553002: When we switch tabs in chrome, the tab being switched away from gets hidden/shown/hidden. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments Created 6 years, 3 months 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 | « content/browser/web_contents/web_contents_view_aura.h ('k') | ui/views/controls/webview/DEPS » ('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 (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
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
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
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura.h ('k') | ui/views/controls/webview/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698