Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: chrome/browser/ui/views/frame/glass_browser_frame_view.cc

Issue 10827198: Change View::HitTest to View::HitTestRect (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 PaintToolbarBackground(canvas); 231 PaintToolbarBackground(canvas);
232 if (!frame()->IsMaximized()) 232 if (!frame()->IsMaximized())
233 PaintRestoredClientEdge(canvas); 233 PaintRestoredClientEdge(canvas);
234 } 234 }
235 235
236 void GlassBrowserFrameView::Layout() { 236 void GlassBrowserFrameView::Layout() {
237 LayoutAvatar(); 237 LayoutAvatar();
238 LayoutClientView(); 238 LayoutClientView();
239 } 239 }
240 240
241 bool GlassBrowserFrameView::HitTest(const gfx::Point& l) const { 241 bool GlassBrowserFrameView::HitTest(const gfx::Rect& r) const {
242 if (r.IsEmpty()) {
243 gfx::Point p(r.x(), r.y());
244 return (avatar_button() &&
245 avatar_button()->GetMirroredBounds().Contains(p)) ||
246 !frame()->client_view()->bounds().Contains(p);
247 }
242 return (avatar_button() && 248 return (avatar_button() &&
243 avatar_button()->GetMirroredBounds().Contains(l)) || 249 avatar_button()->GetMirroredBounds().Intersects(r)) ||
244 !frame()->client_view()->bounds().Contains(l); 250 !frame()->client_view()->bounds().Intersects(r);
245 } 251 }
246 252
247 /////////////////////////////////////////////////////////////////////////////// 253 ///////////////////////////////////////////////////////////////////////////////
248 // GlassBrowserFrameView, private: 254 // GlassBrowserFrameView, private:
249 255
250 int GlassBrowserFrameView::FrameBorderThickness() const { 256 int GlassBrowserFrameView::FrameBorderThickness() const {
251 return (frame()->IsMaximized() || frame()->IsFullscreen()) ? 257 return (frame()->IsMaximized() || frame()->IsFullscreen()) ?
252 0 : GetSystemMetrics(SM_CXSIZEFRAME); 258 0 : GetSystemMetrics(SM_CXSIZEFRAME);
253 } 259 }
254 260
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 static bool initialized = false; 521 static bool initialized = false;
516 if (!initialized) { 522 if (!initialized) {
517 for (int i = 0; i < kThrobberIconCount; ++i) { 523 for (int i = 0; i < kThrobberIconCount; ++i) {
518 throbber_icons_[i] = 524 throbber_icons_[i] =
519 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); 525 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i);
520 DCHECK(throbber_icons_[i]); 526 DCHECK(throbber_icons_[i]);
521 } 527 }
522 initialized = true; 528 initialized = true;
523 } 529 }
524 } 530 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698