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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view_layout.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/browser_view_layout.h" 5 #include "chrome/browser/ui/views/frame/browser_view_layout.h"
6 6
7 #include "chrome/browser/ui/find_bar/find_bar.h" 7 #include "chrome/browser/ui/find_bar/find_bar.h"
8 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 8 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
9 #include "chrome/browser/ui/view_ids.h" 9 #include "chrome/browser/ui/view_ids.h"
10 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 10 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
(...skipping 24 matching lines...) Expand all
35 const int kWindowSwitcherOffsetX = 7; 35 const int kWindowSwitcherOffsetX = 7;
36 36
37 // Combines View::ConvertPointToView and View::HitTest for a given |point|. 37 // Combines View::ConvertPointToView and View::HitTest for a given |point|.
38 // Converts |point| from |src| to |dst| and hit tests it against |dst|. The 38 // Converts |point| from |src| to |dst| and hit tests it against |dst|. The
39 // converted |point| can then be retrieved and used for additional tests. 39 // converted |point| can then be retrieved and used for additional tests.
40 bool ConvertedHitTest(views::View* src, views::View* dst, gfx::Point* point) { 40 bool ConvertedHitTest(views::View* src, views::View* dst, gfx::Point* point) {
41 DCHECK(src); 41 DCHECK(src);
42 DCHECK(dst); 42 DCHECK(dst);
43 DCHECK(point); 43 DCHECK(point);
44 views::View::ConvertPointToView(src, dst, point); 44 views::View::ConvertPointToView(src, dst, point);
45 return dst->HitTest(*point); 45 return dst->HitTest(gfx::Rect(*point, gfx::Size(0, 0)));
46 } 46 }
47 47
48 } // namespace 48 } // namespace
49 49
50 //////////////////////////////////////////////////////////////////////////////// 50 ////////////////////////////////////////////////////////////////////////////////
51 // BrowserViewLayout, public: 51 // BrowserViewLayout, public:
52 52
53 BrowserViewLayout::BrowserViewLayout() 53 BrowserViewLayout::BrowserViewLayout()
54 : tabstrip_(NULL), 54 : tabstrip_(NULL),
55 toolbar_(NULL), 55 toolbar_(NULL),
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 bottom -= height; 477 bottom -= height;
478 } 478 }
479 return bottom; 479 return bottom;
480 } 480 }
481 481
482 bool BrowserViewLayout::InfobarVisible() const { 482 bool BrowserViewLayout::InfobarVisible() const {
483 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. 483 // NOTE: Can't check if the size IsEmpty() since it's always 0-width.
484 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && 484 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) &&
485 (infobar_container_->GetPreferredSize().height() != 0); 485 (infobar_container_->GetPreferredSize().height() != 0);
486 } 486 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698