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 "chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.h" | 5 #include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 tabstrip_bounds = | 318 tabstrip_bounds = |
319 display::win::ScreenWin::DIPToClientRect(hwnd, tabstrip_bounds); | 319 display::win::ScreenWin::DIPToClientRect(hwnd, tabstrip_bounds); |
320 | 320 |
321 // Extend inwards far enough to go under the semitransparent client edges. | 321 // Extend inwards far enough to go under the semitransparent client edges. |
322 const gfx::Insets thicknesses = GetClientEdgeThicknesses(); | 322 const gfx::Insets thicknesses = GetClientEdgeThicknesses(); |
323 gfx::Point left_top = display::win::ScreenWin::DIPToClientPoint( | 323 gfx::Point left_top = display::win::ScreenWin::DIPToClientPoint( |
324 hwnd, gfx::Point(thicknesses.left(), thicknesses.top())); | 324 hwnd, gfx::Point(thicknesses.left(), thicknesses.top())); |
325 gfx::Point right_bottom = display::win::ScreenWin::DIPToClientPoint( | 325 gfx::Point right_bottom = display::win::ScreenWin::DIPToClientPoint( |
326 hwnd, gfx::Point(thicknesses.right(), thicknesses.bottom())); | 326 hwnd, gfx::Point(thicknesses.right(), thicknesses.bottom())); |
327 | 327 |
328 if (base::win::GetVersion() <= base::win::VERSION_WIN7) { | 328 if (base::win::GetVersion() < base::win::VERSION_WIN8) { |
329 // The 2 px (not DIP) at the inner edges of the glass are a light and | 329 // The 2 px (not DIP) at the inner edges of the glass are a light and |
330 // dark line, so we must inset further to account for those. | 330 // dark line, so we must inset further to account for those. |
331 constexpr gfx::Vector2d kDWMEdgeThickness(2, 2); | 331 constexpr gfx::Vector2d kDWMEdgeThickness(2, 2); |
332 left_top += kDWMEdgeThickness; | 332 left_top += kDWMEdgeThickness; |
333 right_bottom += kDWMEdgeThickness; | 333 right_bottom += kDWMEdgeThickness; |
334 } | 334 } |
335 | 335 |
336 return MARGINS{left_top.x(), right_bottom.x(), | 336 return MARGINS{left_top.x(), right_bottom.x(), |
337 tabstrip_bounds.bottom() + left_top.y(), right_bottom.y()}; | 337 tabstrip_bounds.bottom() + left_top.y(), right_bottom.y()}; |
338 } | 338 } |
339 | 339 |
340 //////////////////////////////////////////////////////////////////////////////// | 340 //////////////////////////////////////////////////////////////////////////////// |
341 // BrowserDesktopWindowTreeHost, public: | 341 // BrowserDesktopWindowTreeHost, public: |
342 | 342 |
343 // static | 343 // static |
344 BrowserDesktopWindowTreeHost* | 344 BrowserDesktopWindowTreeHost* |
345 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( | 345 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( |
346 views::internal::NativeWidgetDelegate* native_widget_delegate, | 346 views::internal::NativeWidgetDelegate* native_widget_delegate, |
347 views::DesktopNativeWidgetAura* desktop_native_widget_aura, | 347 views::DesktopNativeWidgetAura* desktop_native_widget_aura, |
348 BrowserView* browser_view, | 348 BrowserView* browser_view, |
349 BrowserFrame* browser_frame) { | 349 BrowserFrame* browser_frame) { |
350 return new BrowserDesktopWindowTreeHostWin(native_widget_delegate, | 350 return new BrowserDesktopWindowTreeHostWin(native_widget_delegate, |
351 desktop_native_widget_aura, | 351 desktop_native_widget_aura, |
352 browser_view, | 352 browser_view, |
353 browser_frame); | 353 browser_frame); |
354 } | 354 } |
OLD | NEW |