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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 944763002: Make Page Visibility API work when the browser window is visible or not Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use of SetWindowVisibility message Created 5 years, 8 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 | « ui/views/widget/desktop_aura/desktop_native_widget_aura.h ('k') | no next file » | 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 "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
6 6
7 #include <X11/extensions/shape.h> 7 #include <X11/extensions/shape.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xregion.h> 10 #include <X11/Xregion.h>
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 &unused); 1744 &unused);
1745 } 1745 }
1746 gfx::Rect bounds_in_pixels(translated_x_in_pixels, translated_y_in_pixels, 1746 gfx::Rect bounds_in_pixels(translated_x_in_pixels, translated_y_in_pixels,
1747 xev->xconfigure.width, xev->xconfigure.height); 1747 xev->xconfigure.width, xev->xconfigure.height);
1748 bool size_changed = bounds_in_pixels_.size() != bounds_in_pixels.size(); 1748 bool size_changed = bounds_in_pixels_.size() != bounds_in_pixels.size();
1749 bool origin_changed = 1749 bool origin_changed =
1750 bounds_in_pixels_.origin() != bounds_in_pixels.origin(); 1750 bounds_in_pixels_.origin() != bounds_in_pixels.origin();
1751 previous_bounds_in_pixels_ = bounds_in_pixels_; 1751 previous_bounds_in_pixels_ = bounds_in_pixels_;
1752 bounds_in_pixels_ = bounds_in_pixels; 1752 bounds_in_pixels_ = bounds_in_pixels;
1753 1753
1754 if (origin_changed) 1754 if (origin_changed) {
1755 OnHostMoved(bounds_in_pixels_.origin()); 1755 OnHostMoved(bounds_in_pixels_.origin());
1756 // Allows visibilityChange events to be triggered while switching
1757 // between workspaces.
1758 ::Screen* screen = DefaultScreenOfDisplay(xdisplay_);
1759 int screen_width = WidthOfScreen(screen);
1760 int screen_height = HeightOfScreen(screen);
1761
1762 if (translated_x_in_pixels < 0 || translated_x_in_pixels > screen_width
1763 || translated_y_in_pixels < 0 ||
1764 translated_y_in_pixels > screen_height)
1765 OnHostSetWindowVisibility(false);
1766 else
1767 OnHostSetWindowVisibility(true);
1768 }
1756 1769
1757 if (size_changed) { 1770 if (size_changed) {
1758 delayed_resize_task_.Reset(base::Bind( 1771 delayed_resize_task_.Reset(base::Bind(
1759 &DesktopWindowTreeHostX11::DelayedResize, 1772 &DesktopWindowTreeHostX11::DelayedResize,
1760 close_widget_factory_.GetWeakPtr(), bounds_in_pixels.size())); 1773 close_widget_factory_.GetWeakPtr(), bounds_in_pixels.size()));
1761 base::MessageLoop::current()->PostTask( 1774 base::MessageLoop::current()->PostTask(
1762 FROM_HERE, delayed_resize_task_.callback()); 1775 FROM_HERE, delayed_resize_task_.callback());
1763 } 1776 }
1764 break; 1777 break;
1765 } 1778 }
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1985 if (linux_ui) { 1998 if (linux_ui) {
1986 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); 1999 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window);
1987 if (native_theme) 2000 if (native_theme)
1988 return native_theme; 2001 return native_theme;
1989 } 2002 }
1990 2003
1991 return ui::NativeTheme::instance(); 2004 return ui::NativeTheme::instance();
1992 } 2005 }
1993 2006
1994 } // namespace views 2007 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698