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

Issue 10069043: Makes the status bubble less janky on chromeos. Any time the bounds (Closed)

Created:
8 years, 8 months ago by sky
Modified:
8 years, 8 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Makes the status bubble less janky on chromeos. Any time the bounds change we need to adjust based on where the mouse is. Not sure why we didn't notice this on windows. BUG=123256 TEST=see bug R=ben@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=132246

Patch Set 1 #

Patch Set 2 : Add null check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -3 lines) Patch
M chrome/browser/ui/views/status_bubble_views.h View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/status_bubble_views.cc View 1 5 chunks +8 lines, -3 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
sky
8 years, 8 months ago (2012-04-13 00:11:28 UTC) #1
Ben Goodger (Google)
8 years, 8 months ago (2012-04-13 00:46:11 UTC) #2
LGTM

On Thu, Apr 12, 2012 at 5:11 PM, <sky@chromium.org> wrote:

> Reviewers: Ben Goodger (Google),
>
> Description:
> Makes the status bubble less janky on chromeos. Any time the bounds
> change we need to adjust based on where the mouse is. Not sure why we
> didn't notice this on windows.
>
> BUG=123256
> TEST=see bug
> R=ben@chromium.org
>
>
> Please review this at
http://codereview.chromium.**org/10069043/<http://codereview.chromium.org/100...
>
> SVN Base:
svn://svn.chromium.org/chrome/**trunk/src<http://svn.chromium.org/chrome/trunk/src>
>
> Affected files:
>  M chrome/browser/ui/views/**status_bubble_views.h
>  M chrome/browser/ui/views/**status_bubble_views.cc
>
>
> Index: chrome/browser/ui/views/**status_bubble_views.cc
> diff --git a/chrome/browser/ui/views/**status_bubble_views.cc
> b/chrome/browser/ui/views/**status_bubble_views.cc
> index 917d44f4c942678d1a874aac9860a4**43a9fe61e4..**
> d9cbe5d761d3b0e945f09809719948**27e9c95bdf 100644
> --- a/chrome/browser/ui/views/**status_bubble_views.cc
> +++ b/chrome/browser/ui/views/**status_bubble_views.cc
> @@ -72,7 +72,8 @@ class StatusBubbleViews::StatusView : public
> views::Label,
>                                       public ui::LinearAnimation,
>                                       public ui::AnimationDelegate {
>  public:
> -  StatusView(StatusBubble* status_bubble, views::Widget* popup,
> +  StatusView(StatusBubble* status_bubble,
> +             views::Widget* popup,
>              ui::ThemeProvider* theme_provider)
>       : ALLOW_THIS_IN_INITIALIZER_**LIST(ui::LinearAnimation(**kFramerate,
> this)),
>         stage_(BUBBLE_HIDDEN),
> @@ -313,7 +314,6 @@ double
StatusBubbleViews::StatusView:**:GetCurrentOpacity()
> {
>
>  void StatusBubbleViews::StatusView:**:SetOpacity(double opacity) {
>   popup_->SetOpacity(static_**cast<unsigned char>(opacity * 255));
> -  SchedulePaint();
>  }
>
>  void StatusBubbleViews::StatusView:**:AnimateToState(double state) {
> @@ -544,7 +544,8 @@ void
StatusBubbleViews::**StatusViewExpander::**SetBubbleWidth(int
> width) {
>  const int StatusBubbleViews::**kShadowThickness = 1;
>
>  StatusBubbleViews::**StatusBubbleViews(views::View* base_view)
> -    : offset_(0),
> +    : contains_mouse_(false),
> +      offset_(0),
>       popup_(NULL),
>       opacity_(0),
>       base_view_(base_view),
> @@ -604,6 +605,8 @@ void StatusBubbleViews::SetBounds(**int x, int y, int
> w, int h) {
>   position_.SetPoint(base_view_-**>GetMirroredXWithWidthInView(**x, w),
> y);
>   size_.SetSize(w, h);
>   Reposition();
> +  if (contains_mouse_)
> +    AvoidMouse(last_mouse_moved_**location_);
>  }
>
>  void StatusBubbleViews::SetStatus(**const string16& status_text) {
> @@ -692,8 +695,10 @@ void StatusBubbleViews::Hide() {
>
>  void StatusBubbleViews::MouseMoved(**const gfx::Point& location,
>                                    bool left_content) {
> +  contains_mouse_ = !left_content;
>   if (left_content)
>     return;
> +  last_mouse_moved_location_ = location;
>
>   if (view_) {
>     view_->ResetTimer();
> Index: chrome/browser/ui/views/**status_bubble_views.h
> diff --git a/chrome/browser/ui/views/**status_bubble_views.h
> b/chrome/browser/ui/views/**status_bubble_views.h
> index 2a3905a9e8823ffeefbb526c15b157**163d2760f2..**
> a53bd41a79f24882b75bcada3a40e9**9ad4be5918 100644
> --- a/chrome/browser/ui/views/**status_bubble_views.h
> +++ b/chrome/browser/ui/views/**status_bubble_views.h
> @@ -110,6 +110,12 @@ class StatusBubbleViews : public StatusBubble {
>   gfx::Point position_;
>   gfx::Size size_;
>
> +  // Last location passed to MouseMoved().
> +  gfx::Point last_mouse_moved_location_;
> +
> +  // Whether the view contains the mouse.
> +  bool contains_mouse_;
> +
>   // How vertically offset the bubble is from its root position_.
>   int offset_;
>
>
>
>

Powered by Google App Engine
This is Rietveld 408576698