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

Side by Side Diff: chrome/browser/ui/views/bubble/border_contents.cc

Issue 8493011: Merge 108537 - Align avatar bubble with edge of anchor control (Closed) Base URL: svn://svn.chromium.org/chrome/branches/912/src/
Patch Set: 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/ui/views/bubble/border_contents.h" 5 #include "chrome/browser/ui/views/bubble/border_contents.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/ui/window_sizer.h" 10 #include "chrome/browser/ui/window_sizer.h"
(...skipping 20 matching lines...) Expand all
31 31
32 bubble_border_ = new views::BubbleBorder(arrow_location); 32 bubble_border_ = new views::BubbleBorder(arrow_location);
33 set_border(bubble_border_); 33 set_border(bubble_border_);
34 set_background(new views::BubbleBackground(bubble_border_)); 34 set_background(new views::BubbleBackground(bubble_border_));
35 } 35 }
36 36
37 void BorderContents::SetBackgroundColor(SkColor color) { 37 void BorderContents::SetBackgroundColor(SkColor color) {
38 bubble_border_->set_background_color(color); 38 bubble_border_->set_background_color(color);
39 } 39 }
40 40
41 void BorderContents::SetAlignment(
42 views::BubbleBorder::BubbleAlignment alignment) {
43 bubble_border_->set_alignment(alignment);
44 }
45
41 void BorderContents::SizeAndGetBounds( 46 void BorderContents::SizeAndGetBounds(
42 const gfx::Rect& position_relative_to, 47 const gfx::Rect& position_relative_to,
43 views::BubbleBorder::ArrowLocation arrow_location, 48 views::BubbleBorder::ArrowLocation arrow_location,
44 bool allow_bubble_offscreen, 49 bool allow_bubble_offscreen,
45 const gfx::Size& contents_size, 50 const gfx::Size& contents_size,
46 gfx::Rect* contents_bounds, 51 gfx::Rect* contents_bounds,
47 gfx::Rect* window_bounds) { 52 gfx::Rect* window_bounds) {
48 if (base::i18n::IsRTL()) 53 if (base::i18n::IsRTL())
49 arrow_location = views::BubbleBorder::horizontal_mirror(arrow_location); 54 arrow_location = views::BubbleBorder::horizontal_mirror(arrow_location);
50 bubble_border_->set_arrow_location(arrow_location); 55 bubble_border_->set_arrow_location(arrow_location);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 int right = std::max(0, window_bounds.right() - monitor_bounds.right()); 156 int right = std::max(0, window_bounds.right() - monitor_bounds.right());
152 157
153 offscreen_insets->Set(top, left, bottom, right); 158 offscreen_insets->Set(top, left, bottom, right);
154 return true; 159 return true;
155 } 160 }
156 161
157 // static 162 // static
158 int BorderContents::GetInsetsLength(const gfx::Insets& insets, bool vertical) { 163 int BorderContents::GetInsetsLength(const gfx::Insets& insets, bool vertical) {
159 return vertical ? insets.height() : insets.width(); 164 return vertical ? insets.height() : insets.width();
160 } 165 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bubble/border_contents.h ('k') | chrome/browser/ui/views/bubble/bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698