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

Side by Side Diff: chrome/browser/notifications/balloon_collection_gtk.cc

Issue 8503037: Fix the problem that notifications and panels overlap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 9 years, 1 month 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
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 #include "chrome/browser/notifications/balloon_collection_impl.h" 5 #include "chrome/browser/notifications/balloon_collection_impl.h"
6 6
7 #include "chrome/browser/notifications/balloon.h" 7 #include "chrome/browser/notifications/balloon.h"
8 #include "ui/gfx/size.h" 8 #include "ui/gfx/size.h"
9 9
10 #if defined(TOOLKIT_VIEWS) 10 #if defined(TOOLKIT_VIEWS)
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 int BalloonCollectionImpl::Layout::HorizontalEdgeMargin() const { 30 int BalloonCollectionImpl::Layout::HorizontalEdgeMargin() const {
31 return 5; 31 return 5;
32 } 32 }
33 33
34 int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const { 34 int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const {
35 return 5; 35 return 5;
36 } 36 }
37 37
38 bool BalloonCollectionImpl::Layout::NeedToMoveAboveLeftSidePanels() const {
39 return placement_ == VERTICALLY_FROM_BOTTOM_LEFT;
40 }
41
42 bool BalloonCollectionImpl::Layout::NeedToMoveAboveRightSidePanels() const {
43 return placement_ == VERTICALLY_FROM_BOTTOM_RIGHT;
44 }
45
38 void BalloonCollectionImpl::PositionBalloons(bool reposition) { 46 void BalloonCollectionImpl::PositionBalloons(bool reposition) {
39 PositionBalloonsInternal(reposition); 47 PositionBalloonsInternal(reposition);
40 } 48 }
41 49
42 #if defined(TOUCH_UI) 50 #if defined(TOUCH_UI)
43 base::EventStatus BalloonCollectionImpl::WillProcessEvent( 51 base::EventStatus BalloonCollectionImpl::WillProcessEvent(
44 const base::NativeEvent& event) { 52 const base::NativeEvent& event) {
45 return base::EVENT_CONTINUE; 53 return base::EVENT_CONTINUE;
46 } 54 }
47 55
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_RIGHT); 93 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_RIGHT);
86 else if (position == UPPER_LEFT) 94 else if (position == UPPER_LEFT)
87 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_LEFT); 95 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_LEFT);
88 else if (position == LOWER_LEFT) 96 else if (position == LOWER_LEFT)
89 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_LEFT); 97 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_LEFT);
90 else if (position == LOWER_RIGHT) 98 else if (position == LOWER_RIGHT)
91 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_RIGHT); 99 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_RIGHT);
92 else 100 else
93 NOTREACHED(); 101 NOTREACHED();
94 102
103 layout_.ComputeOffsetToMoveAbovePanels(gfx::Rect());
95 PositionBalloons(true); 104 PositionBalloons(true);
96 } 105 }
97 106
98 // static 107 // static
99 BalloonCollection* BalloonCollection::Create() { 108 BalloonCollection* BalloonCollection::Create() {
100 return new BalloonCollectionImpl(); 109 return new BalloonCollectionImpl();
101 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698