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

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: Rebase 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
« no previous file with comments | « ui/views/bubble/bubble_border.cc ('k') | ui/views/bubble/bubble_frame_view.h » ('j') | 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) 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* border = new BubbleBorder(arrow_loc, BubbleBorder::NO_SHADOW);
190 border->set_background_color(color());
191 BubbleFrameView* frame_view = new BubbleFrameView(margins(), border);
192 frame_view->set_background(new BubbleBackground(border));
193 return frame_view;
185 } 194 }
186 195
187 void BubbleDelegateView::OnWidgetClosing(Widget* widget) { 196 void BubbleDelegateView::OnWidgetClosing(Widget* widget) {
188 if (anchor_widget() == widget) { 197 if (anchor_widget() == widget) {
189 anchor_view_ = NULL; 198 anchor_view_ = NULL;
190 anchor_widget_ = NULL; 199 anchor_widget_ = NULL;
191 } 200 }
192 } 201 }
193 202
194 void BubbleDelegateView::OnWidgetVisibilityChanged(Widget* widget, 203 void BubbleDelegateView::OnWidgetVisibilityChanged(Widget* widget,
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 336
328 #if defined(OS_WIN) && !defined(USE_AURA) 337 #if defined(OS_WIN) && !defined(USE_AURA)
329 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { 338 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const {
330 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); 339 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView());
331 client_bounds.Offset(border_widget_->GetWindowBoundsInScreen().origin()); 340 client_bounds.Offset(border_widget_->GetWindowBoundsInScreen().origin());
332 return client_bounds; 341 return client_bounds;
333 } 342 }
334 #endif 343 #endif
335 344
336 } // namespace views 345 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_border.cc ('k') | ui/views/bubble/bubble_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698