OLD | NEW |
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/wm_overview_title.h" | 5 #include "chrome/browser/chromeos/wm_overview_title.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "app/x11_util.h" | 9 #include "app/x11_util.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 static const int kVerticalPadding = 2; | 36 static const int kVerticalPadding = 2; |
37 | 37 |
38 // This is the size (in pixels) of the drop shadow on the title and url text. | 38 // This is the size (in pixels) of the drop shadow on the title and url text. |
39 static const int kDropShadowSize = 2; | 39 static const int kDropShadowSize = 2; |
40 | 40 |
41 namespace { | 41 namespace { |
42 // Finds a font based on the base font that is no taller than the | 42 // Finds a font based on the base font that is no taller than the |
43 // given value (well, unless the font at size 1 is taller than the | 43 // given value (well, unless the font at size 1 is taller than the |
44 // given value). | 44 // given value). |
45 Font FindFontThisHigh(int pixels, Font base) { | 45 Font FindFontThisHigh(int pixels, Font base) { |
46 Font font = Font::CreateFont(base.FontName(), 1); | 46 Font font(base.GetFontName(), 1); |
47 Font last_font = font; | 47 Font last_font = font; |
48 while (font.height() < pixels) { | 48 while (font.GetHeight() < pixels) { |
49 last_font = font; | 49 last_font = font; |
50 font = font.DeriveFont(1, Font::BOLD); | 50 font = font.DeriveFont(1, Font::BOLD); |
51 } | 51 } |
52 return last_font; | 52 return last_font; |
53 } | 53 } |
54 } // Anonymous namespace | 54 } // Anonymous namespace |
55 | 55 |
56 WmOverviewTitle::WmOverviewTitle() | 56 WmOverviewTitle::WmOverviewTitle() |
57 : WidgetGtk(TYPE_WINDOW), | 57 : WidgetGtk(TYPE_WINDOW), |
58 title_label_(NULL), | 58 title_label_(NULL), |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 void WmOverviewTitle::SetTitle(const string16& title) { | 109 void WmOverviewTitle::SetTitle(const string16& title) { |
110 title_label_->SetText(UTF16ToWide(title)); | 110 title_label_->SetText(UTF16ToWide(title)); |
111 } | 111 } |
112 | 112 |
113 void WmOverviewTitle::SetUrl(const GURL& url) { | 113 void WmOverviewTitle::SetUrl(const GURL& url) { |
114 url_label_->SetURL(url); | 114 url_label_->SetURL(url); |
115 } | 115 } |
116 } // namespace chromeos | 116 } // namespace chromeos |
OLD | NEW |