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 "chrome/browser/ui/views/confirm_bubble_views.h" | 5 #include "chrome/browser/ui/views/confirm_bubble_views.h" |
6 | 6 |
7 #include "chrome/browser/ui/confirm_bubble.h" | 7 #include "chrome/browser/ui/confirm_bubble.h" |
8 #include "chrome/browser/ui/confirm_bubble_model.h" | 8 #include "chrome/browser/ui/confirm_bubble_model.h" |
9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 layout->AddView(icon_view); | 78 layout->AddView(icon_view); |
79 | 79 |
80 const string16 title_text = model_->GetTitle(); | 80 const string16 title_text = model_->GetTitle(); |
81 DCHECK(!title_text.empty()); | 81 DCHECK(!title_text.empty()); |
82 views::Label* title_label = new views::Label(title_text); | 82 views::Label* title_label = new views::Label(title_text); |
83 title_label->SetFont(bundle.GetFont(ui::ResourceBundle::MediumFont)); | 83 title_label->SetFont(bundle.GetFont(ui::ResourceBundle::MediumFont)); |
84 layout->AddView(title_label); | 84 layout->AddView(title_label); |
85 | 85 |
86 views::ImageButton* close_button = new views::ImageButton(this); | 86 views::ImageButton* close_button = new views::ImageButton(this); |
87 const gfx::ImageSkia* close_image = | 87 const gfx::ImageSkia* close_image = |
88 bundle.GetImageNamed(IDR_INFO_BUBBLE_CLOSE).ToImageSkia(); | 88 bundle.GetImageNamed(IDR_WEB_UI_CLOSE).ToImageSkia(); |
89 close_button->SetImage(views::CustomButton::STATE_NORMAL, close_image); | 89 close_button->SetImage(views::CustomButton::STATE_NORMAL, close_image); |
90 close_button->set_tag(ConfirmBubbleModel::BUTTON_NONE); | 90 close_button->set_tag(ConfirmBubbleModel::BUTTON_NONE); |
91 layout->AddView(close_button); | 91 layout->AddView(close_button); |
92 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 92 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
93 | 93 |
94 // Add the message label to the second row. | 94 // Add the message label to the second row. |
95 cs = layout->AddColumnSet(1); | 95 cs = layout->AddColumnSet(1); |
96 const string16 message_text = model_->GetMessageText(); | 96 const string16 message_text = model_->GetMessageText(); |
97 DCHECK(!message_text.empty()); | 97 DCHECK(!message_text.empty()); |
98 views::Label* message_label = new views::Label(message_text); | 98 views::Label* message_label = new views::Label(message_text); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 void ShowConfirmBubble(gfx::NativeView view, | 156 void ShowConfirmBubble(gfx::NativeView view, |
157 const gfx::Point& origin, | 157 const gfx::Point& origin, |
158 ConfirmBubbleModel* model) { | 158 ConfirmBubbleModel* model) { |
159 ConfirmBubbleViews* bubble = new ConfirmBubbleViews(origin, model); | 159 ConfirmBubbleViews* bubble = new ConfirmBubbleViews(origin, model); |
160 views::BubbleDelegateView::CreateBubble(bubble); | 160 views::BubbleDelegateView::CreateBubble(bubble); |
161 bubble->Show(); | 161 bubble->Show(); |
162 } | 162 } |
163 | 163 |
164 } // namespace chrome | 164 } // namespace chrome |
OLD | NEW |