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

Side by Side Diff: ui/views/bubble/bubble_delegate.cc

Issue 10808066: Fix position of web notification bubble and arrow (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/bubble/bubble_delegate.h" 5 #include "ui/views/bubble/bubble_delegate.h"
6 6
7 #include "ui/base/animation/slide_animation.h" 7 #include "ui/base/animation/slide_animation.h"
8 #include "ui/gfx/color_utils.h" 8 #include "ui/gfx/color_utils.h"
9 #include "ui/views/bubble/bubble_frame_view.h" 9 #include "ui/views/bubble/bubble_frame_view.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 BubbleDelegateView* BubbleDelegateView::AsBubbleDelegate() { 174 BubbleDelegateView* BubbleDelegateView::AsBubbleDelegate() {
175 return this; 175 return this;
176 } 176 }
177 177
178 View* BubbleDelegateView::GetContentsView() { 178 View* BubbleDelegateView::GetContentsView() {
179 return this; 179 return this;
180 } 180 }
181 181
182 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView( 182 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView(
183 Widget* widget) { 183 Widget* widget) {
184 return new BubbleFrameView(arrow_location(), color(), margins()); 184 BubbleBorder::ArrowLocation arrow_loc = arrow_location();
185 if (base::i18n::IsRTL())
186 arrow_loc = BubbleBorder::horizontal_mirror(arrow_loc);
187 // TODO(alicet): Expose the shadow option in BorderContentsView when we make
188 // the fullscreen exit bubble use the new bubble code.
189 BubbleBorder* bubble_border =
msw 2012/07/27 20:32:04 nit: rename border to fit on one line.
stevenjb 2012/07/30 20:09:03 Done.
190 new BubbleBorder(arrow_loc, BubbleBorder::NO_SHADOW);
191 bubble_border->set_background_color(color());
192 BubbleFrameView* frame_view = new BubbleFrameView(margins(), bubble_border);
193 frame_view->set_background(new BubbleBackground(bubble_border));
194 return frame_view;
185 } 195 }
186 196
187 void BubbleDelegateView::OnWidgetClosing(Widget* widget) { 197 void BubbleDelegateView::OnWidgetClosing(Widget* widget) {
188 if (anchor_widget() == widget) { 198 if (anchor_widget() == widget) {
189 anchor_view_ = NULL; 199 anchor_view_ = NULL;
190 anchor_widget_ = NULL; 200 anchor_widget_ = NULL;
191 } 201 }
192 } 202 }
193 203
194 void BubbleDelegateView::OnWidgetVisibilityChanged(Widget* widget, 204 void BubbleDelegateView::OnWidgetVisibilityChanged(Widget* widget,
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 337
328 #if defined(OS_WIN) && !defined(USE_AURA) 338 #if defined(OS_WIN) && !defined(USE_AURA)
329 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { 339 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const {
330 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); 340 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView());
331 client_bounds.Offset(border_widget_->GetWindowBoundsInScreen().origin()); 341 client_bounds.Offset(border_widget_->GetWindowBoundsInScreen().origin());
332 return client_bounds; 342 return client_bounds;
333 } 343 }
334 #endif 344 #endif
335 345
336 } // namespace views 346 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698