| 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_standard.h" | 7 #include "grit/ui_resources_standard.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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 //////////////////////////////////////////////////////////////////////////////// | 65 //////////////////////////////////////////////////////////////////////////////// |
| 66 // DialogFrameView, public: | 66 // DialogFrameView, public: |
| 67 | 67 |
| 68 DialogFrameView::DialogFrameView() { | 68 DialogFrameView::DialogFrameView() { |
| 69 set_background(views::Background::CreateSolidBackground( | 69 set_background(views::Background::CreateSolidBackground( |
| 70 kDialogBackgroundColor)); | 70 kDialogBackgroundColor)); |
| 71 | 71 |
| 72 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 72 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 73 close_button_ = new views::ImageButton(this); | 73 close_button_ = new views::ImageButton(this); |
| 74 close_button_->SetImage(views::CustomButton::BS_NORMAL, | 74 close_button_->SetImage(views::CustomButton::BS_NORMAL, |
| 75 rb.GetImageNamed(IDR_CLOSE_BAR).ToSkBitmap()); | 75 rb.GetImageNamed(IDR_CLOSE_BAR).ToImageSkia()); |
| 76 close_button_->SetImage(views::CustomButton::BS_HOT, | 76 close_button_->SetImage(views::CustomButton::BS_HOT, |
| 77 rb.GetImageNamed(IDR_CLOSE_BAR_H).ToSkBitmap()); | 77 rb.GetImageNamed(IDR_CLOSE_BAR_H).ToImageSkia()); |
| 78 close_button_->SetImage(views::CustomButton::BS_PUSHED, | 78 close_button_->SetImage(views::CustomButton::BS_PUSHED, |
| 79 rb.GetImageNamed(IDR_CLOSE_BAR_P).ToSkBitmap()); | 79 rb.GetImageNamed(IDR_CLOSE_BAR_P).ToImageSkia()); |
| 80 close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, | 80 close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, |
| 81 views::ImageButton::ALIGN_MIDDLE); | 81 views::ImageButton::ALIGN_MIDDLE); |
| 82 AddChildView(close_button_); | 82 AddChildView(close_button_); |
| 83 } | 83 } |
| 84 | 84 |
| 85 DialogFrameView::~DialogFrameView() { | 85 DialogFrameView::~DialogFrameView() { |
| 86 } | 86 } |
| 87 | 87 |
| 88 //////////////////////////////////////////////////////////////////////////////// | 88 //////////////////////////////////////////////////////////////////////////////// |
| 89 // DialogFrameView, views::NonClientFrameView: | 89 // DialogFrameView, views::NonClientFrameView: |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |