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/window/dialog_frame_view.h" | 5 #include "ui/views/window/dialog_frame_view.h" |
6 | 6 |
7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
8 #include "ui/base/hit_test.h" | 8 #include "ui/base/hit_test.h" |
9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 namespace views { | 31 namespace views { |
32 | 32 |
33 //////////////////////////////////////////////////////////////////////////////// | 33 //////////////////////////////////////////////////////////////////////////////// |
34 // DialogFrameView, public: | 34 // DialogFrameView, public: |
35 | 35 |
36 DialogFrameView::DialogFrameView(const string16& title) | 36 DialogFrameView::DialogFrameView(const string16& title) |
37 : title_(NULL), | 37 : title_(NULL), |
38 close_(NULL) { | 38 close_(NULL) { |
39 BubbleBorder* border = | 39 BubbleBorder* border = |
40 new BubbleBorder(BubbleBorder::FLOAT, BubbleBorder::SMALL_SHADOW); | 40 new BubbleBorder(BubbleBorder::FLOAT, BubbleBorder::SMALL_SHADOW, |
41 border->set_background_color(GetNativeTheme()->GetSystemColor( | 41 GetNativeTheme()->GetSystemColor( |
42 ui::NativeTheme::kColorId_DialogBackground)); | 42 ui::NativeTheme::kColorId_DialogBackground)); |
43 set_border(border); | 43 set_border(border); |
44 // Update the background, which relies on the border. | 44 // Update the background, which relies on the border. |
45 set_background(new BubbleBackground(border)); | 45 set_background(new BubbleBackground(border)); |
46 | 46 |
47 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 47 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
48 title_ = new Label(title, rb.GetFont(ui::ResourceBundle::MediumFont)); | 48 title_ = new Label(title, rb.GetFont(ui::ResourceBundle::MediumFont)); |
49 title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 49 title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
50 AddChildView(title_); | 50 AddChildView(title_); |
51 | 51 |
52 close_ = new LabelButton(this, string16()); | 52 close_ = new LabelButton(this, string16()); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 //////////////////////////////////////////////////////////////////////////////// | 133 //////////////////////////////////////////////////////////////////////////////// |
134 // DialogFrameView, private: | 134 // DialogFrameView, private: |
135 | 135 |
136 gfx::Insets DialogFrameView::GetClientInsets() const { | 136 gfx::Insets DialogFrameView::GetClientInsets() const { |
137 gfx::Insets insets = border()->GetInsets(); | 137 gfx::Insets insets = border()->GetInsets(); |
138 insets += content_margins_; | 138 insets += content_margins_; |
139 return insets; | 139 return insets; |
140 } | 140 } |
141 | 141 |
142 } // namespace views | 142 } // namespace views |
OLD | NEW |