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/utf_string_conversions.h" | 8 #include "base/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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 PaintToolbarBackground(canvas); | 235 PaintToolbarBackground(canvas); |
236 if (!frame()->IsMaximized()) | 236 if (!frame()->IsMaximized()) |
237 PaintRestoredClientEdge(canvas); | 237 PaintRestoredClientEdge(canvas); |
238 } | 238 } |
239 | 239 |
240 void GlassBrowserFrameView::Layout() { | 240 void GlassBrowserFrameView::Layout() { |
241 LayoutAvatar(); | 241 LayoutAvatar(); |
242 LayoutClientView(); | 242 LayoutClientView(); |
243 } | 243 } |
244 | 244 |
245 bool GlassBrowserFrameView::HitTest(const gfx::Point& l) const { | 245 bool GlassBrowserFrameView::HitTestRect(const gfx::Rect& rect) const { |
246 return (avatar_button() && | 246 return (avatar_button() && |
247 avatar_button()->GetMirroredBounds().Contains(l)) || | 247 avatar_button()->GetMirroredBounds().Intersects(rect)) || |
248 !frame()->client_view()->bounds().Contains(l); | 248 !frame()->client_view()->bounds().Intersects(rect); |
249 } | 249 } |
250 | 250 |
251 /////////////////////////////////////////////////////////////////////////////// | 251 /////////////////////////////////////////////////////////////////////////////// |
252 // GlassBrowserFrameView, private: | 252 // GlassBrowserFrameView, private: |
253 | 253 |
254 int GlassBrowserFrameView::FrameBorderThickness() const { | 254 int GlassBrowserFrameView::FrameBorderThickness() const { |
255 return (frame()->IsMaximized() || frame()->IsFullscreen()) ? | 255 return (frame()->IsMaximized() || frame()->IsFullscreen()) ? |
256 0 : GetSystemMetrics(SM_CXSIZEFRAME); | 256 0 : GetSystemMetrics(SM_CXSIZEFRAME); |
257 } | 257 } |
258 | 258 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 static bool initialized = false; | 520 static bool initialized = false; |
521 if (!initialized) { | 521 if (!initialized) { |
522 for (int i = 0; i < kThrobberIconCount; ++i) { | 522 for (int i = 0; i < kThrobberIconCount; ++i) { |
523 throbber_icons_[i] = | 523 throbber_icons_[i] = |
524 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); | 524 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); |
525 DCHECK(throbber_icons_[i]); | 525 DCHECK(throbber_icons_[i]); |
526 } | 526 } |
527 initialized = true; | 527 initialized = true; |
528 } | 528 } |
529 } | 529 } |
OLD | NEW |