| 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/aero_glass_non_client_view.h" | 5 #include "chrome/browser/views/frame/aero_glass_non_client_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/views/frame/browser_view.h" | 7 #include "chrome/browser/views/frame/browser_view.h" |
| 8 #include "chrome/browser/views/tabs/tab_strip.h" | 8 #include "chrome/browser/views/tabs/tab_strip.h" |
| 9 #include "chrome/common/resource_bundle.h" | 9 #include "chrome/common/resource_bundle.h" |
| 10 #include "chrome/views/client_view.h" | 10 #include "chrome/views/client_view.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 int width, | 144 int width, |
| 145 int height) const { | 145 int height) const { |
| 146 int border_thickness = NonClientBorderThickness(); | 146 int border_thickness = NonClientBorderThickness(); |
| 147 return gfx::Size(width + (2 * border_thickness), | 147 return gfx::Size(width + (2 * border_thickness), |
| 148 height + NonClientTopBorderHeight() + border_thickness); | 148 height + NonClientTopBorderHeight() + border_thickness); |
| 149 } | 149 } |
| 150 | 150 |
| 151 gfx::Point AeroGlassNonClientView::GetSystemMenuPoint() const { | 151 gfx::Point AeroGlassNonClientView::GetSystemMenuPoint() const { |
| 152 gfx::Point system_menu_point; | 152 gfx::Point system_menu_point; |
| 153 if (browser_view_->IsTabStripVisible()) { | 153 if (browser_view_->IsTabStripVisible()) { |
| 154 system_menu_point.SetPoint( | 154 // The maximized mode bit here is because in maximized mode the frame edge |
| 155 NonClientBorderThickness() - kClientEdgeThickness, | 155 // and the client edge are both offscreen, whereas in the opaque frame |
| 156 NonClientTopBorderHeight() + browser_view_->GetTabStripHeight()); | 156 // (where we don't do this trick) maximized windows have no client edge and |
| 157 // only the frame edge is offscreen. |
| 158 system_menu_point.SetPoint(NonClientBorderThickness() - |
| 159 (frame_->IsMaximized() ? 0 : kClientEdgeThickness), |
| 160 NonClientTopBorderHeight() + browser_view_->GetTabStripHeight() - |
| 161 kClientEdgeThickness); |
| 157 } else { | 162 } else { |
| 158 system_menu_point.SetPoint(0, -kFrameShadowThickness); | 163 system_menu_point.SetPoint(0, -kFrameShadowThickness); |
| 159 } | 164 } |
| 160 ConvertPointToScreen(this, &system_menu_point); | 165 ConvertPointToScreen(this, &system_menu_point); |
| 161 return system_menu_point; | 166 return system_menu_point; |
| 162 } | 167 } |
| 163 | 168 |
| 164 int AeroGlassNonClientView::NonClientHitTest(const gfx::Point& point) { | 169 int AeroGlassNonClientView::NonClientHitTest(const gfx::Point& point) { |
| 165 // If we don't have a tabstrip, we haven't customized the frame, so Windows | 170 // If we don't have a tabstrip, we haven't customized the frame, so Windows |
| 166 // can figure this out. If the point isn't within our bounds, then it's in | 171 // can figure this out. If the point isn't within our bounds, then it's in |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 353 |
| 349 #if defined(GOOGLE_CHROME_BUILD) | 354 #if defined(GOOGLE_CHROME_BUILD) |
| 350 distributor_logo_ = ResourceBundle::GetSharedInstance(). | 355 distributor_logo_ = ResourceBundle::GetSharedInstance(). |
| 351 GetBitmapNamed(IDR_DISTRIBUTOR_LOGO); | 356 GetBitmapNamed(IDR_DISTRIBUTOR_LOGO); |
| 352 #endif | 357 #endif |
| 353 | 358 |
| 354 initialized = true; | 359 initialized = true; |
| 355 } | 360 } |
| 356 } | 361 } |
| 357 | 362 |
| OLD | NEW |