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

Side by Side Diff: chrome/browser/chromeos/notifications/notification_panel.cc

Issue 7747044: [chromeos] Do not move notifications to KEEP_SIZE state when mouse moved. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/notifications/notification_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Draws the view for the balloons. 5 // Draws the view for the balloons.
6 6
7 #include "chrome/browser/chromeos/notifications/notification_panel.h" 7 #include "chrome/browser/chromeos/notifications/notification_panel.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 644
645 void NotificationPanel::OnMouseLeave() { 645 void NotificationPanel::OnMouseLeave() {
646 SetActiveView(NULL); 646 SetActiveView(NULL);
647 if (balloon_container_->GetNotificationCount() == 0) 647 if (balloon_container_->GetNotificationCount() == 0)
648 SET_STATE(CLOSED); 648 SET_STATE(CLOSED);
649 UpdatePanel(true); 649 UpdatePanel(true);
650 } 650 }
651 651
652 void NotificationPanel::OnMouseMotion(const gfx::Point& point) { 652 void NotificationPanel::OnMouseMotion(const gfx::Point& point) {
653 SetActiveView(balloon_container_->FindBalloonView(point)); 653 SetActiveView(balloon_container_->FindBalloonView(point));
654 SET_STATE(KEEP_SIZE);
655 // We need to set the focus to scroll view to get mouse wheel 654 // We need to set the focus to scroll view to get mouse wheel
656 // working. Setting focus when mouse moves on the panel 655 // working. Setting focus when mouse moves on the panel
657 // because focus may be taken by other view. 656 // because focus may be taken by other view.
658 scroll_view_->RequestFocus(); 657 scroll_view_->RequestFocus();
658 // This method used to set KEEP_SIZE state. However,
659 // some html notifications may want to change their size,
660 // and setting KEEP_SIZE caused them to behave differently
661 // depending on whether user moved mouse over notification
662 // or not.
659 } 663 }
660 664
661 NotificationPanelTester* NotificationPanel::GetTester() { 665 NotificationPanelTester* NotificationPanel::GetTester() {
662 if (!tester_.get()) 666 if (!tester_.get())
663 tester_.reset(new NotificationPanelTester(this)); 667 tester_.reset(new NotificationPanelTester(this));
664 return tester_.get(); 668 return tester_.get();
665 } 669 }
666 670
667 //////////////////////////////////////////////////////////////////////////////// 671 ////////////////////////////////////////////////////////////////////////////////
668 // NotificationPanel private. 672 // NotificationPanel private.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 &origin); 866 &origin);
863 return rect.Contains(gfx::Rect(origin, view->size())); 867 return rect.Contains(gfx::Rect(origin, view->size()));
864 } 868 }
865 869
866 870
867 bool NotificationPanelTester::IsActive(const BalloonViewImpl* view) const { 871 bool NotificationPanelTester::IsActive(const BalloonViewImpl* view) const {
868 return panel_->active_ == view; 872 return panel_->active_ == view;
869 } 873 }
870 874
871 } // namespace chromeos 875 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/notifications/notification_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698