| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 return gfx::Rect(rect); | 188 return gfx::Rect(rect); |
| 189 } | 189 } |
| 190 | 190 |
| 191 gfx::Insets insets = GetClientAreaInsets(); | 191 gfx::Insets insets = GetClientAreaInsets(); |
| 192 return gfx::Rect(std::max(0, client_bounds.x() - insets.left()), | 192 return gfx::Rect(std::max(0, client_bounds.x() - insets.left()), |
| 193 std::max(0, client_bounds.y() - insets.top()), | 193 std::max(0, client_bounds.y() - insets.top()), |
| 194 client_bounds.width() + insets.width(), | 194 client_bounds.width() + insets.width(), |
| 195 client_bounds.height() + insets.height()); | 195 client_bounds.height() + insets.height()); |
| 196 } | 196 } |
| 197 | 197 |
| 198 int GlassBrowserFrameView::NonClientHitTest(const gfx::Point& point) { | 198 int GlassBrowserFrameView::NonClientHitTest(const gfx::Point& point) const { |
| 199 // If the browser isn't in normal mode, we haven't customized the frame, so | 199 // If the browser isn't in normal mode, we haven't customized the frame, so |
| 200 // Windows can figure this out. If the point isn't within our bounds, then | 200 // Windows can figure this out. If the point isn't within our bounds, then |
| 201 // it's in the native portion of the frame, so again Windows can figure it | 201 // it's in the native portion of the frame, so again Windows can figure it |
| 202 // out. | 202 // out. |
| 203 if (!browser_view()->IsBrowserTypeNormal() || !bounds().Contains(point)) | 203 if (!browser_view()->IsBrowserTypeNormal() || !bounds().Contains(point)) |
| 204 return HTNOWHERE; | 204 return HTNOWHERE; |
| 205 | 205 |
| 206 // See if the point is within the avatar menu button or within the avatar | 206 // See if the point is within the avatar menu button or within the avatar |
| 207 // label. | 207 // label. |
| 208 if (avatar_button() && avatar_button()->GetMirroredBounds().Contains(point)) | 208 if (avatar_button() && avatar_button()->GetMirroredBounds().Contains(point)) |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 static bool initialized = false; | 512 static bool initialized = false; |
| 513 if (!initialized) { | 513 if (!initialized) { |
| 514 for (int i = 0; i < kThrobberIconCount; ++i) { | 514 for (int i = 0; i < kThrobberIconCount; ++i) { |
| 515 throbber_icons_[i] = | 515 throbber_icons_[i] = |
| 516 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); | 516 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); |
| 517 DCHECK(throbber_icons_[i]); | 517 DCHECK(throbber_icons_[i]); |
| 518 } | 518 } |
| 519 initialized = true; | 519 initialized = true; |
| 520 } | 520 } |
| 521 } | 521 } |
| OLD | NEW |