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 "ash/wm/dialog_frame_view.h" | 5 #include "ash/wm/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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 if (!delegate) | 145 if (!delegate) |
146 return; | 146 return; |
147 canvas->DrawStringInt(delegate->GetWindowTitle(), GetTitleFont(), | 147 canvas->DrawStringInt(delegate->GetWindowTitle(), GetTitleFont(), |
148 kDialogTitleColor, title_display_rect_); | 148 kDialogTitleColor, title_display_rect_); |
149 } | 149 } |
150 | 150 |
151 //////////////////////////////////////////////////////////////////////////////// | 151 //////////////////////////////////////////////////////////////////////////////// |
152 // DialogFrameView, views::ButtonListener overrides: | 152 // DialogFrameView, views::ButtonListener overrides: |
153 | 153 |
154 void DialogFrameView::ButtonPressed(views::Button* sender, | 154 void DialogFrameView::ButtonPressed(views::Button* sender, |
155 const views::Event& event) { | 155 const ui::Event& event) { |
156 if (sender == close_button_) | 156 if (sender == close_button_) |
157 GetWidget()->Close(); | 157 GetWidget()->Close(); |
158 } | 158 } |
159 | 159 |
160 //////////////////////////////////////////////////////////////////////////////// | 160 //////////////////////////////////////////////////////////////////////////////// |
161 // DialogFrameView, private: | 161 // DialogFrameView, private: |
162 | 162 |
163 gfx::Insets DialogFrameView::GetPaddingInsets() const { | 163 gfx::Insets DialogFrameView::GetPaddingInsets() const { |
164 // These three discrete padding sizes come from the spec. If we ever wanted | 164 // These three discrete padding sizes come from the spec. If we ever wanted |
165 // our Google-style dialogs to be resizable, we would probably need to | 165 // our Google-style dialogs to be resizable, we would probably need to |
(...skipping 20 matching lines...) Expand all Loading... |
186 GetTitleFont().GetHeight() + GetTitleFont().GetFontSize() - | 186 GetTitleFont().GetHeight() + GetTitleFont().GetFontSize() - |
187 kDialogTopPaddingNudge, | 187 kDialogTopPaddingNudge, |
188 -kDialogHPaddingNudge, | 188 -kDialogHPaddingNudge, |
189 -kDialogBottomPaddingNudge, | 189 -kDialogBottomPaddingNudge, |
190 -kDialogHPaddingNudge); | 190 -kDialogHPaddingNudge); |
191 return insets; | 191 return insets; |
192 } | 192 } |
193 | 193 |
194 } // namespace internal | 194 } // namespace internal |
195 } // namespace views | 195 } // namespace views |
OLD | NEW |