summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-15 16:28:51 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-15 16:28:51 +0000
commit74db479680863c2094c44825b8b28ad7572e4e60 (patch)
tree1b99fccd35f05406b35a45d6caa512d5ee5b286f /views/widget
parentdaaaef4c3fa2cf8ccc6e49cb40c359c10ae79c9b (diff)
downloadchromium_src-74db479680863c2094c44825b8b28ad7572e4e60.zip
chromium_src-74db479680863c2094c44825b8b28ad7572e4e60.tar.gz
chromium_src-74db479680863c2094c44825b8b28ad7572e4e60.tar.bz2
Revert 49795 - Changes the tab close button to a dot, unless you're near the button
or the tab is selected. I'm not to keen on the mouse near names, if you have better ideas please say so. BUG=45743 TEST=none Review URL: http://codereview.chromium.org/2796006 TBR=sky@chromium.org Review URL: http://codereview.chromium.org/2823005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/root_view.cc71
-rw-r--r--views/widget/root_view.h24
2 files changed, 0 insertions, 95 deletions
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc
index 2a6798c..3ea101c 100644
--- a/views/widget/root_view.cc
+++ b/views/widget/root_view.cc
@@ -489,33 +489,6 @@ void RootView::OnMouseMoved(const MouseEvent& e) {
mouse_move_handler_->OnMouseExited(exited_event);
SetActiveCursor(NULL);
}
-
- if (registered_near_views_.empty())
- return;
-
- std::set<View*> near_views;
- GetViewsRegisteredForNearNotification(e, &near_views);
-
- MouseEvent exited_near_event(Event::ET_MOUSE_EXITED_NEAR, 0, 0, 0);
- for (std::set<View*>::const_iterator i = near_views_.begin();
- i != near_views_.end(); ++i) {
- if (near_views.find(*i) == near_views.end())
- (*i)->OnMouseExitedNear(exited_near_event);
- }
-
- for (std::set<View*>::const_iterator i = near_views.begin();
- i != near_views.end(); ++i) {
- if (near_views_.find(*i) == near_views_.end()) {
- MouseEvent entered_event(Event::ET_MOUSE_ENTERED,
- this,
- *i,
- e.location(),
- 0);
- (*i)->OnMouseNear(entered_event);
- }
- }
-
- near_views_.swap(near_views);
}
void RootView::ProcessOnMouseExited() {
@@ -524,8 +497,6 @@ void RootView::ProcessOnMouseExited() {
mouse_move_handler_->OnMouseExited(exited_event);
mouse_move_handler_ = NULL;
}
-
- SendMouseExitedNear();
}
void RootView::SetMouseHandler(View *new_mh) {
@@ -909,14 +880,6 @@ void RootView::UnregisterViewForVisibleBoundsNotification(View* view) {
}
}
-void RootView::RegisterViewForNearNotification(View* view) {
- registered_near_views_.insert(view);
-}
-
-void RootView::UnregisterViewForNearNotification(View* view) {
- registered_near_views_.erase(view);
-}
-
void RootView::SetMouseLocationAndFlags(const MouseEvent& e) {
last_mouse_event_flags_ = e.GetFlags();
last_mouse_event_x_ = e.x();
@@ -973,38 +936,4 @@ void RootView::SetActiveCursor(gfx::NativeCursor cursor) {
#endif
}
-void RootView::GetViewsRegisteredForNearNotification(
- const MouseEvent& e,
- std::set<View*>* near_views) {
- const gfx::Point& location = e.location();
- for (std::set<View*>::const_iterator i = registered_near_views_.begin();
- i != registered_near_views_.end(); ++i) {
- View* view = *i;
- DCHECK(view->near_insets_.get());
- const gfx::Insets& insets = *view->near_insets_;
- gfx::Point view_loc(view->x() - insets.left(),
- view->y() - insets.top());
- View::ConvertPointToView(view->GetParent(), this, &view_loc);
- if (location.x() >= view_loc.x() &&
- location.y() >= view_loc.y() &&
- location.x() < view_loc.x() + (view->width() + insets.width()) &&
- location.y() < view_loc.y() + (view->height() + insets.height())) {
- near_views->insert(view);
- }
- }
-}
-
-void RootView::SendMouseExitedNear() {
- if (near_views_.empty())
- return;
-
- MouseEvent exited_near_event(Event::ET_MOUSE_EXITED_NEAR, 0, 0, 0);
- for (std::set<View*>::const_iterator i = near_views_.begin();
- i != near_views_.end(); ++i) {
- (*i)->OnMouseExitedNear(exited_near_event);
- }
-
- near_views_.clear();
-}
-
} // namespace views
diff --git a/views/widget/root_view.h b/views/widget/root_view.h
index ba1d5d22..05887e1 100644
--- a/views/widget/root_view.h
+++ b/views/widget/root_view.h
@@ -5,7 +5,6 @@
#ifndef VIEWS_WIDGET_ROOT_VIEW_H_
#define VIEWS_WIDGET_ROOT_VIEW_H_
-#include <set>
#include <string>
#include "base/ref_counted.h"
@@ -218,10 +217,6 @@ class RootView : public View,
void RegisterViewForVisibleBoundsNotification(View* view);
void UnregisterViewForVisibleBoundsNotification(View* view);
- // Registers/unregisters the View for mouse near events.
- void RegisterViewForNearNotification(View* view);
- void UnregisterViewForNearNotification(View* view);
-
// Returns the next focusable view or view containing a FocusTraversable (NULL
// if none was found), starting at the starting_view.
// check_starting_view, can_go_up and can_go_down controls the traversal of
@@ -263,15 +258,6 @@ class RootView : public View,
// Sets the current cursor, or resets it to the last one if NULL is provided.
void SetActiveCursor(gfx::NativeCursor cursor);
- // Returns in |near_views| the set of views registered for mouse near events
- // that overlap with the location of the specified event.
- void GetViewsRegisteredForNearNotification(const MouseEvent& e,
- std::set<View*>* near_views);
-
- // Sends OnMouseExitedNear to the set of views the mouse is near and empties
- // the set.
- void SendMouseExitedNear();
-
// The view currently handing down - drag - up
View* mouse_pressed_handler_;
@@ -344,16 +330,6 @@ class RootView : public View,
bool is_processing_paint_;
#endif
- // Set of views registered for mouse near events.
- // NOTE: because views registered for near mouse events can overlap other
- // views and extend outside the bounds of themselves and ancestors we store
- // the registered views here and treat them separately. This is generally ok
- // as there are a small set of views registered for near notification.
- std::set<View*> registered_near_views_;
-
- // Set of views the mouse is currently near.
- std::set<View*> near_views_;
-
DISALLOW_COPY_AND_ASSIGN(RootView);
};