Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/frame/browser_frame_win.h" | 5 #include "chrome/browser/views/frame/browser_frame_win.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 // for popups/apps. | 115 // for popups/apps. |
| 116 return GetThemeProvider()->ShouldUseNativeFrame() || | 116 return GetThemeProvider()->ShouldUseNativeFrame() || |
| 117 (!browser_view_->IsBrowserTypeNormal() && | 117 (!browser_view_->IsBrowserTypeNormal() && |
| 118 win_util::ShouldUseVistaFrame()); | 118 win_util::ShouldUseVistaFrame()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 /////////////////////////////////////////////////////////////////////////////// | 121 /////////////////////////////////////////////////////////////////////////////// |
| 122 // BrowserFrame, views::WindowWin overrides: | 122 // BrowserFrame, views::WindowWin overrides: |
| 123 | 123 |
| 124 gfx::Insets BrowserFrameWin::GetClientAreaInsets() const { | 124 gfx::Insets BrowserFrameWin::GetClientAreaInsets() const { |
| 125 if (!GetNonClientView()->UseNativeFrame()) | 125 // Use the default client insets for an opaque frame or a glass popup/app |
| 126 // frame. | |
| 127 if (!GetNonClientView()->UseNativeFrame() || | |
| 128 !browser_view_->IsBrowserTypeNormal()) { | |
|
Peter Kasting
2009/10/26 07:41:24
Nit: No need for {}.
| |
| 126 return WindowWin::GetClientAreaInsets(); | 129 return WindowWin::GetClientAreaInsets(); |
| 130 } | |
| 127 | 131 |
| 128 int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME); | 132 int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME); |
| 129 // We draw our own client edge over part of the default frame. | 133 // We draw our own client edge over part of the default frame. |
| 130 if (!IsMaximized()) | 134 if (!IsMaximized()) |
| 131 border_thickness -= kClientEdgeThickness; | 135 border_thickness -= kClientEdgeThickness; |
| 132 return gfx::Insets(0, border_thickness, border_thickness, border_thickness); | 136 return gfx::Insets(0, border_thickness, border_thickness, border_thickness); |
| 133 } | 137 } |
| 134 | 138 |
| 135 bool BrowserFrameWin::GetAccelerator(int cmd_id, | 139 bool BrowserFrameWin::GetAccelerator(int cmd_id, |
| 136 views::Accelerator* accelerator) { | 140 views::Accelerator* accelerator) { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 328 // more "transparent" look. | 332 // more "transparent" look. |
| 329 ::SetWindowLong(frame_hwnd, GWL_STYLE, | 333 ::SetWindowLong(frame_hwnd, GWL_STYLE, |
| 330 saved_window_style_ & ~WS_CAPTION); | 334 saved_window_style_ & ~WS_CAPTION); |
| 331 SetLayeredWindowAttributes(frame_hwnd, RGB(0xFF, 0xFF, 0xFF), | 335 SetLayeredWindowAttributes(frame_hwnd, RGB(0xFF, 0xFF, 0xFF), |
| 332 kTabDragWindowAlpha, LWA_ALPHA); | 336 kTabDragWindowAlpha, LWA_ALPHA); |
| 333 } else { | 337 } else { |
| 334 ::SetWindowLong(frame_hwnd, GWL_STYLE, saved_window_style_); | 338 ::SetWindowLong(frame_hwnd, GWL_STYLE, saved_window_style_); |
| 335 ::SetWindowLong(frame_hwnd, GWL_EXSTYLE, saved_window_ex_style_); | 339 ::SetWindowLong(frame_hwnd, GWL_EXSTYLE, saved_window_ex_style_); |
| 336 } | 340 } |
| 337 } | 341 } |
| OLD | NEW |