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

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

Issue 216763002: DesktopWindowTreeHostX11::GetWindowBoundsInScreen returns window bounds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « extensions/browser/app_window/app_window_browsertest.cc ('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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 } else if (IsMaximized()) { 437 } else if (IsMaximized()) {
438 *show_state = ui::SHOW_STATE_MAXIMIZED; 438 *show_state = ui::SHOW_STATE_MAXIMIZED;
439 } else if (!IsActive()) { 439 } else if (!IsActive()) {
440 *show_state = ui::SHOW_STATE_INACTIVE; 440 *show_state = ui::SHOW_STATE_INACTIVE;
441 } else { 441 } else {
442 *show_state = ui::SHOW_STATE_NORMAL; 442 *show_state = ui::SHOW_STATE_NORMAL;
443 } 443 }
444 } 444 }
445 445
446 gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const { 446 gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
447 // Use ui::GetOuterWindowBounds to get the window bounds including the frame.
448 gfx::Rect bounds;
449 if (xwindow_) {
450 if (ui::GetOuterWindowBounds(xwindow_, &bounds))
451 return bounds;
452 }
453
454 // Fall back to just returning the known bounds (which does not include the
455 // frame).
447 return bounds_; 456 return bounds_;
448 } 457 }
449 458
450 gfx::Rect DesktopWindowTreeHostX11::GetClientAreaBoundsInScreen() const { 459 gfx::Rect DesktopWindowTreeHostX11::GetClientAreaBoundsInScreen() const {
451 // TODO(erg): The NativeWidgetAura version returns |bounds_|, claiming its 460 // TODO(erg): The NativeWidgetAura version returns |bounds_|, claiming its
452 // needed for View::ConvertPointToScreen() to work 461 // needed for View::ConvertPointToScreen() to work
453 // correctly. DesktopWindowTreeHostWin::GetClientAreaBoundsInScreen() just 462 // correctly. DesktopWindowTreeHostWin::GetClientAreaBoundsInScreen() just
454 // asks windows what it thinks the client rect is. 463 // asks windows what it thinks the client rect is.
455 // 464 //
456 // Attempts to calculate the rect by asking the NonClientFrameView what it 465 // Attempts to calculate the rect by asking the NonClientFrameView what it
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 if (linux_ui) { 1952 if (linux_ui) {
1944 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); 1953 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window);
1945 if (native_theme) 1954 if (native_theme)
1946 return native_theme; 1955 return native_theme;
1947 } 1956 }
1948 1957
1949 return ui::NativeTheme::instance(); 1958 return ui::NativeTheme::instance();
1950 } 1959 }
1951 1960
1952 } // namespace views 1961 } // namespace views
OLDNEW
« no previous file with comments | « extensions/browser/app_window/app_window_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698