gfx::Rect NativeWindowViews::ContentBoundsToWindowBounds(
const gfx::Rect& bounds) {
- if (!has_frame())
- return bounds;
-
gfx::Rect window_bounds(bounds);
#if defined(OS_WIN)
HWND hwnd = GetAcceleratedWidget();
window_->non_client_view()->GetWindowBoundsForClientBounds(dpi_bounds));
#endif
- if (menu_bar_ && menu_bar_visible_) {
+ if (has_frame() && menu_bar_ && menu_bar_visible_) {
window_bounds.set_y(window_bounds.y() - kMenuBarHeight);
window_bounds.set_height(window_bounds.height() + kMenuBarHeight);
}
gfx::Rect NativeWindowViews::WindowBoundsToContentBounds(
const gfx::Rect& bounds) {
- if (!has_frame())
- return bounds;
-
gfx::Rect content_bounds(bounds);
#if defined(OS_WIN)
HWND hwnd = GetAcceleratedWidget();
display::win::ScreenWin::ScreenToDIPSize(hwnd, content_bounds.size()));
#endif
- if (menu_bar_ && menu_bar_visible_) {
+ if (has_frame() && menu_bar_ && menu_bar_visible_) {
content_bounds.set_y(content_bounds.y() + kMenuBarHeight);
content_bounds.set_height(content_bounds.height() - kMenuBarHeight);
}