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

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: rebase cleanup 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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | ui/message_center/views/notification_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 42835490b6401cedfaf0876b52a6c1977048510f..271c399565e46ffbe9bdc0aa5ab6d72d8622a779 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;
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | ui/message_center/views/notification_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698