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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 381323002: [rough WIP] Make View::GetEventHandlerForRect() non-virtual (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 0f7a15149ebfcc47cd16138b52f1bbe043c1010d..acb0ed36412724fcb3771e7f0aef86a3bede29f8 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -52,6 +52,7 @@
#include "ui/views/mouse_watcher_view_host.h"
#include "ui/views/rect_based_targeting_utils.h"
#include "ui/views/view_model_utils.h"
+#include "ui/views/view_targeter.h"
#include "ui/views/widget/root_view.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/non_client_view.h"
@@ -537,6 +538,8 @@ TabStrip::TabStrip(TabStripController* controller)
mouse_move_count_(0),
immersive_style_(false) {
Init();
+ SetEventTargeter(
+ scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
}
TabStrip::~TabStrip() {
@@ -1412,15 +1415,18 @@ void TabStrip::GetAccessibleState(ui::AXViewState* state) {
state->role = ui::AX_ROLE_TAB_LIST;
}
-views::View* TabStrip::GetEventHandlerForRect(const gfx::Rect& rect) {
+views::View* TabStrip::TargetForRect(views::View* root,
+ const gfx::Rect& rect) {
+ CHECK_EQ(root, this);
+
if (!views::UsePointBasedTargeting(rect))
- return View::GetEventHandlerForRect(rect);
+ return views::ViewTargeterDelegate::TargetForRect(root, rect);
const gfx::Point point(rect.CenterPoint());
if (!touch_layout_) {
// Return any view that isn't a Tab or this TabStrip immediately. We don't
// want to interfere.
- views::View* v = View::GetEventHandlerForRect(rect);
+ views::View* v = views::ViewTargeterDelegate::TargetForRect(root, rect);
if (v && v != this && strcmp(v->GetClassName(), Tab::kViewClassName))
return v;

Powered by Google App Engine
This is Rietveld 408576698