Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(481)

Side by Side Diff: chrome/browser/ui/views/confirm_bubble_views.cc

Issue 11818044: Replace IDR_WEB_UI_CLOSE* with IDR_CLOSE_DIALOG*, cleanup, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/ui_resources.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
11 #include "ui/gfx/image/image.h" 11 #include "ui/gfx/image/image.h"
12 #include "ui/views/controls/button/image_button.h" 12 #include "ui/views/controls/button/image_button.h"
13 #include "ui/views/controls/button/text_button.h" 13 #include "ui/views/controls/button/text_button.h"
14 #include "ui/views/controls/image_view.h" 14 #include "ui/views/controls/image_view.h"
15 #include "ui/views/controls/label.h" 15 #include "ui/views/controls/label.h"
16 #include "ui/views/controls/link.h" 16 #include "ui/views/controls/link.h"
17 #include "ui/views/layout/grid_layout.h" 17 #include "ui/views/layout/grid_layout.h"
18 #include "ui/views/layout/layout_constants.h" 18 #include "ui/views/layout/layout_constants.h"
19 #include "ui/views/widget/widget.h" 19 #include "ui/views/widget/widget.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 icon_view->SetImage(icon_image->ToImageSkia()); 77 icon_view->SetImage(icon_image->ToImageSkia());
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 close_button->SetImage(views::CustomButton::STATE_NORMAL,
88 bundle.GetImageNamed(IDR_WEB_UI_CLOSE).ToImageSkia(); 88 bundle.GetImageNamed(IDR_CLOSE_DIALOG).ToImageSkia());
tfarina 2013/01/10 19:32:48 can you use GetImageSkiaNamed directly here?
msw 2013/01/10 19:59:49 Done.
89 close_button->SetImage(views::CustomButton::STATE_NORMAL, close_image); 89 close_button->SetImage(views::CustomButton::STATE_HOVERED,
90 bundle.GetImageNamed(IDR_CLOSE_DIALOG_H).ToImageSkia());
91 close_button->SetImage(views::CustomButton::STATE_PRESSED,
92 bundle.GetImageNamed(IDR_CLOSE_DIALOG_P).ToImageSkia());
90 close_button->set_tag(ConfirmBubbleModel::BUTTON_NONE); 93 close_button->set_tag(ConfirmBubbleModel::BUTTON_NONE);
91 layout->AddView(close_button); 94 layout->AddView(close_button);
92 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); 95 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
93 96
94 // Add the message label to the second row. 97 // Add the message label to the second row.
95 cs = layout->AddColumnSet(1); 98 cs = layout->AddColumnSet(1);
96 const string16 message_text = model_->GetMessageText(); 99 const string16 message_text = model_->GetMessageText();
97 DCHECK(!message_text.empty()); 100 DCHECK(!message_text.empty());
98 views::Label* message_label = new views::Label(message_text); 101 views::Label* message_label = new views::Label(message_text);
99 int message_width = 102 int message_width =
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 158
156 void ShowConfirmBubble(gfx::NativeView view, 159 void ShowConfirmBubble(gfx::NativeView view,
157 const gfx::Point& origin, 160 const gfx::Point& origin,
158 ConfirmBubbleModel* model) { 161 ConfirmBubbleModel* model) {
159 ConfirmBubbleViews* bubble = new ConfirmBubbleViews(origin, model); 162 ConfirmBubbleViews* bubble = new ConfirmBubbleViews(origin, model);
160 views::BubbleDelegateView::CreateBubble(bubble); 163 views::BubbleDelegateView::CreateBubble(bubble);
161 bubble->Show(); 164 bubble->Show();
162 } 165 }
163 166
164 } // namespace chrome 167 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698