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

Side by Side Diff: chrome/browser/chromeos/frame/bubble_frame_view.cc

Issue 5180002: Adjust default font sizes for new hand hinted fonts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - textbutton header Created 10 years, 1 month 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
« no previous file with comments | « build/build_config.h ('k') | chrome/browser/chromeos/input_method/candidate_window.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/chromeos/frame/bubble_frame_view.h" 5 #include "chrome/browser/chromeos/frame/bubble_frame_view.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "gfx/canvas_skia.h" 8 #include "gfx/canvas_skia.h"
9 #include "gfx/font.h" 9 #include "gfx/font.h"
10 #include "gfx/insets.h" 10 #include "gfx/insets.h"
(...skipping 10 matching lines...) Expand all
21 #include "views/window/window.h" 21 #include "views/window/window.h"
22 #include "views/window/window_delegate.h" 22 #include "views/window/window_delegate.h"
23 #include "third_party/skia/include/core/SkPaint.h" 23 #include "third_party/skia/include/core/SkPaint.h"
24 24
25 namespace { 25 namespace {
26 26
27 static const int kTitleTopPadding = 10; 27 static const int kTitleTopPadding = 10;
28 static const int kTitleContentPadding = 10; 28 static const int kTitleContentPadding = 10;
29 static const int kHorizontalPadding = 10; 29 static const int kHorizontalPadding = 10;
30 30
31 // Title font size correction.
32 #if defined(CROS_FONTS_USING_BCI)
33 static const int kTitleFontSizeDelta = 0;
34 #else
35 static const int kTitleFontSizeDelta = 1;
36 #endif
37
31 } // namespace 38 } // namespace
32 39
33 namespace chromeos { 40 namespace chromeos {
34 41
35 BubbleFrameView::BubbleFrameView(views::Window* frame, 42 BubbleFrameView::BubbleFrameView(views::Window* frame,
36 BubbleWindow::Style style) 43 BubbleWindow::Style style)
37 : frame_(frame), 44 : frame_(frame),
38 style_(style), 45 style_(style),
39 title_(NULL), 46 title_(NULL),
40 close_button_(NULL), 47 close_button_(NULL),
41 throbber_(NULL) { 48 throbber_(NULL) {
42 set_border(new BubbleBorder(BubbleBorder::NONE)); 49 set_border(new BubbleBorder(BubbleBorder::NONE));
43 50
44 if (frame_->GetDelegate()->ShouldShowWindowTitle()) { 51 if (frame_->GetDelegate()->ShouldShowWindowTitle()) {
45 title_ = new views::Label(frame_->GetDelegate()->GetWindowTitle()); 52 title_ = new views::Label(frame_->GetDelegate()->GetWindowTitle());
46 title_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); 53 title_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
47 title_->SetFont(title_->font().DeriveFont(1, gfx::Font::BOLD)); 54 title_->SetFont(title_->font().DeriveFont(kFontSizeCorrectionDelta,
55 gfx::Font::BOLD));
48 AddChildView(title_); 56 AddChildView(title_);
49 } 57 }
50 58
51 if (style_ & BubbleWindow::STYLE_XBAR) { 59 if (style_ & BubbleWindow::STYLE_XBAR) {
52 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 60 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
53 close_button_ = new views::ImageButton(this); 61 close_button_ = new views::ImageButton(this);
54 close_button_->SetImage(views::CustomButton::BS_NORMAL, 62 close_button_->SetImage(views::CustomButton::BS_NORMAL,
55 rb.GetBitmapNamed(IDR_CLOSE_BAR)); 63 rb.GetBitmapNamed(IDR_CLOSE_BAR));
56 close_button_->SetImage(views::CustomButton::BS_HOT, 64 close_button_->SetImage(views::CustomButton::BS_HOT,
57 rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); 65 rb.GetBitmapNamed(IDR_CLOSE_BAR_H));
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 PaintBorder(canvas); 221 PaintBorder(canvas);
214 } 222 }
215 223
216 void BubbleFrameView::ButtonPressed(views::Button* sender, 224 void BubbleFrameView::ButtonPressed(views::Button* sender,
217 const views::Event& event) { 225 const views::Event& event) {
218 if (close_button_ != NULL && sender == close_button_) 226 if (close_button_ != NULL && sender == close_button_)
219 frame_->Close(); 227 frame_->Close();
220 } 228 }
221 229
222 } // namespace chromeos 230 } // namespace chromeos
OLDNEW
« no previous file with comments | « build/build_config.h ('k') | chrome/browser/chromeos/input_method/candidate_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698