| 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/glass_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 228 |
| 229 if (new_avatar_button() && | 229 if (new_avatar_button() && |
| 230 new_avatar_button()->GetMirroredBounds().Contains(point)) | 230 new_avatar_button()->GetMirroredBounds().Contains(point)) |
| 231 return HTCLIENT; | 231 return HTCLIENT; |
| 232 | 232 |
| 233 int frame_component = frame()->client_view()->NonClientHitTest(point); | 233 int frame_component = frame()->client_view()->NonClientHitTest(point); |
| 234 | 234 |
| 235 // See if we're in the sysmenu region. We still have to check the tabstrip | 235 // See if we're in the sysmenu region. We still have to check the tabstrip |
| 236 // first so that clicks in a tab don't get treated as sysmenu clicks. | 236 // first so that clicks in a tab don't get treated as sysmenu clicks. |
| 237 int nonclient_border_thickness = NonClientBorderThickness(); | 237 int nonclient_border_thickness = NonClientBorderThickness(); |
| 238 if (gfx::Rect(nonclient_border_thickness, GetSystemMetrics(SM_CXSIZEFRAME), | 238 if (gfx::Rect(nonclient_border_thickness, |
| 239 GetSystemMetrics(SM_CXSMICON), | 239 gfx::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME), |
| 240 GetSystemMetrics(SM_CYSMICON)).Contains(point)) | 240 gfx::win::GetSystemMetricsInDIP(SM_CXSMICON), |
| 241 gfx::win::GetSystemMetricsInDIP(SM_CYSMICON)).Contains(point)) |
| 241 return (frame_component == HTCLIENT) ? HTCLIENT : HTSYSMENU; | 242 return (frame_component == HTCLIENT) ? HTCLIENT : HTSYSMENU; |
| 242 | 243 |
| 243 if (frame_component != HTNOWHERE) | 244 if (frame_component != HTNOWHERE) |
| 244 return frame_component; | 245 return frame_component; |
| 245 | 246 |
| 246 int frame_border_thickness = FrameBorderThickness(); | 247 int frame_border_thickness = FrameBorderThickness(); |
| 247 int window_component = GetHTComponentForFrame(point, frame_border_thickness, | 248 int window_component = GetHTComponentForFrame(point, frame_border_thickness, |
| 248 nonclient_border_thickness, frame_border_thickness, | 249 nonclient_border_thickness, frame_border_thickness, |
| 249 kResizeAreaCornerSize - frame_border_thickness, | 250 kResizeAreaCornerSize - frame_border_thickness, |
| 250 frame()->widget_delegate()->CanResize()); | 251 frame()->widget_delegate()->CanResize()); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT, | 291 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT, |
| 291 signin::GAIA_SERVICE_TYPE_NONE); | 292 signin::GAIA_SERVICE_TYPE_NONE); |
| 292 } | 293 } |
| 293 } | 294 } |
| 294 | 295 |
| 295 /////////////////////////////////////////////////////////////////////////////// | 296 /////////////////////////////////////////////////////////////////////////////// |
| 296 // GlassBrowserFrameView, private: | 297 // GlassBrowserFrameView, private: |
| 297 | 298 |
| 298 int GlassBrowserFrameView::FrameBorderThickness() const { | 299 int GlassBrowserFrameView::FrameBorderThickness() const { |
| 299 return (frame()->IsMaximized() || frame()->IsFullscreen()) ? | 300 return (frame()->IsMaximized() || frame()->IsFullscreen()) ? |
| 300 0 : GetSystemMetrics(SM_CXSIZEFRAME); | 301 0 : gfx::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME); |
| 301 } | 302 } |
| 302 | 303 |
| 303 int GlassBrowserFrameView::NonClientBorderThickness() const { | 304 int GlassBrowserFrameView::NonClientBorderThickness() const { |
| 304 if (frame()->IsMaximized() || frame()->IsFullscreen()) | 305 if (frame()->IsMaximized() || frame()->IsFullscreen()) |
| 305 return 0; | 306 return 0; |
| 306 | 307 |
| 307 return kNonClientBorderThickness; | 308 return kNonClientBorderThickness; |
| 308 } | 309 } |
| 309 | 310 |
| 310 int GlassBrowserFrameView::NonClientTopBorderHeight() const { | 311 int GlassBrowserFrameView::NonClientTopBorderHeight() const { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 static bool initialized = false; | 587 static bool initialized = false; |
| 587 if (!initialized) { | 588 if (!initialized) { |
| 588 for (int i = 0; i < kThrobberIconCount; ++i) { | 589 for (int i = 0; i < kThrobberIconCount; ++i) { |
| 589 throbber_icons_[i] = | 590 throbber_icons_[i] = |
| 590 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); | 591 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); |
| 591 DCHECK(throbber_icons_[i]); | 592 DCHECK(throbber_icons_[i]); |
| 592 } | 593 } |
| 593 initialized = true; | 594 initialized = true; |
| 594 } | 595 } |
| 595 } | 596 } |
| OLD | NEW |