OLD | NEW |
---|---|
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_frame_view.h" | 5 #include "ui/views/bubble/bubble_frame_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 std::max(0, window_bounds.right() - monitor_bounds.right()); | 47 std::max(0, window_bounds.right() - monitor_bounds.right()); |
48 } | 48 } |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 namespace views { | 52 namespace views { |
53 | 53 |
54 // static | 54 // static |
55 const char BubbleFrameView::kViewClassName[] = "BubbleFrameView"; | 55 const char BubbleFrameView::kViewClassName[] = "BubbleFrameView"; |
56 | 56 |
57 // static | |
58 gfx::Insets BubbleFrameView::GetTitleInsets() { | |
59 return gfx::Insets(0, kTitleLeftInset, kTitleTopInset, kTitleLeftInset); | |
msw
2013/08/08 21:56:52
q: is kTitleLeftInset actually desired for the rig
Dan Beam
2013/08/09 01:47:58
I've updated this to be more clear by returning th
| |
60 } | |
61 | |
57 BubbleFrameView::BubbleFrameView(const gfx::Insets& content_margins) | 62 BubbleFrameView::BubbleFrameView(const gfx::Insets& content_margins) |
58 : bubble_border_(NULL), | 63 : bubble_border_(NULL), |
59 content_margins_(content_margins), | 64 content_margins_(content_margins), |
60 title_(NULL), | 65 title_(NULL), |
61 close_(NULL), | 66 close_(NULL), |
62 titlebar_extra_view_(NULL) { | 67 titlebar_extra_view_(NULL) { |
63 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 68 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
64 title_ = new Label(string16(), rb.GetFont(ui::ResourceBundle::MediumFont)); | 69 title_ = new Label(string16(), rb.GetFont(ui::ResourceBundle::MediumFont)); |
65 title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 70 title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
66 AddChildView(title_); | 71 AddChildView(title_); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 // |offscreen_adjust|, e.g. positive |offscreen_adjust| means bubble | 328 // |offscreen_adjust|, e.g. positive |offscreen_adjust| means bubble |
324 // window needs to be moved to the right and that means we need to move arrow | 329 // window needs to be moved to the right and that means we need to move arrow |
325 // to the left, and that means negative offset. | 330 // to the left, and that means negative offset. |
326 bubble_border_->set_arrow_offset( | 331 bubble_border_->set_arrow_offset( |
327 bubble_border_->GetArrowOffset(window_bounds.size()) - offscreen_adjust); | 332 bubble_border_->GetArrowOffset(window_bounds.size()) - offscreen_adjust); |
328 if (offscreen_adjust) | 333 if (offscreen_adjust) |
329 SchedulePaint(); | 334 SchedulePaint(); |
330 } | 335 } |
331 | 336 |
332 } // namespace views | 337 } // namespace views |
OLD | NEW |