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

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

Issue 11698005: Adjust fonts (part of 137349): use standard font sizes in chrome/browser/ui/views (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: crbug.com/166679 Created 7 years, 12 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
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/global_error_bubble_view.h" 5 #include "chrome/browser/ui/views/global_error_bubble_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/ui/global_error/global_error.h" 8 #include "chrome/browser/ui/global_error/global_error.h"
9 #include "chrome/browser/ui/global_error/global_error_service.h" 9 #include "chrome/browser/ui/global_error/global_error_service.h"
10 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 10 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 72 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
73 int resource_id = error_->GetBubbleViewIconResourceID(); 73 int resource_id = error_->GetBubbleViewIconResourceID();
74 scoped_ptr<views::ImageView> image_view(new views::ImageView()); 74 scoped_ptr<views::ImageView> image_view(new views::ImageView());
75 image_view->SetImage(rb.GetImageNamed(resource_id).ToImageSkia()); 75 image_view->SetImage(rb.GetImageNamed(resource_id).ToImageSkia());
76 76
77 string16 title_string(error_->GetBubbleViewTitle()); 77 string16 title_string(error_->GetBubbleViewTitle());
78 scoped_ptr<views::Label> title_label(new views::Label(title_string)); 78 scoped_ptr<views::Label> title_label(new views::Label(title_string));
79 title_label->SetMultiLine(true); 79 title_label->SetMultiLine(true);
80 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 80 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
81 title_label->SetFont(title_label->font().DeriveFont(1)); 81 title_label->SetFont(rb.GetFont(ui::ResourceBundle::MediumFont));
82 82
83 string16 message_string(error_->GetBubbleViewMessage()); 83 string16 message_string(error_->GetBubbleViewMessage());
84 views::Label* message_label = new views::Label(message_string); 84 views::Label* message_label = new views::Label(message_string);
85 message_label->SetMultiLine(true); 85 message_label->SetMultiLine(true);
86 message_label->SizeToFit(kMaxBubbleViewWidth); 86 message_label->SizeToFit(kMaxBubbleViewWidth);
87 message_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 87 message_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
88 88
89 string16 accept_string(error_->GetBubbleViewAcceptButtonLabel()); 89 string16 accept_string(error_->GetBubbleViewAcceptButtonLabel());
90 scoped_ptr<views::TextButton> accept_button( 90 scoped_ptr<views::TextButton> accept_button(
91 new views::NativeTextButton(this, accept_string)); 91 new views::NativeTextButton(this, accept_string));
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 void GlobalErrorBubbleView::WindowClosing() { 164 void GlobalErrorBubbleView::WindowClosing() {
165 if (error_) 165 if (error_)
166 error_->BubbleViewDidClose(browser_); 166 error_->BubbleViewDidClose(browser_);
167 } 167 }
168 168
169 void GlobalErrorBubbleView::CloseBubbleView() { 169 void GlobalErrorBubbleView::CloseBubbleView() {
170 GetWidget()->Close(); 170 GetWidget()->Close();
171 } 171 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698