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

Unified Diff: chrome/browser/ui/views/status_bubble_views.cc

Issue 10069043: Makes the status bubble less janky on chromeos. Any time the bounds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add null check Created 8 years, 8 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/status_bubble_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 917d44f4c942678d1a874aac9860a443a9fe61e4..7f36deaad43979e7c33429c545e9007466d2794d 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 (popup_.get() && 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();
« no previous file with comments | « chrome/browser/ui/views/status_bubble_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698