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

Side by Side Diff: views/window/window.cc

Issue 131027: Hook up "clear browsing data" dialog. It looks like ass right now. The intent... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 6 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
« no previous file with comments | « views/window/dialog_client_view.cc ('k') | views/window/window_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file.
4
5 #include "views/window/window.h"
6
7 #include "app/gfx/font.h"
8 #include "app/l10n_util.h"
9 #include "app/resource_bundle.h"
10 #include "base/gfx/size.h"
11 #include "base/string_util.h"
12
13 namespace views {
14
15 // static
16 int Window::GetLocalizedContentsWidth(int col_resource_id) {
17 double chars = 0;
18 StringToDouble(WideToUTF8(l10n_util::GetString(col_resource_id)), &chars);
19 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
20 gfx::Font font = rb.GetFont(ResourceBundle::BaseFont);
21 int width = font.GetExpectedTextWidth(static_cast<int>(chars));
22 DCHECK(width > 0);
23 return width;
24 }
25
26 // static
27 int Window::GetLocalizedContentsHeight(int row_resource_id) {
28 double lines = 0;
29 StringToDouble(WideToUTF8(l10n_util::GetString(row_resource_id)), &lines);
30 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
31 gfx::Font font = rb.GetFont(ResourceBundle::BaseFont);
32 int height = static_cast<int>(font.height() * lines);
33 DCHECK(height > 0);
34 return height;
35 }
36
37 // static
38 gfx::Size Window::GetLocalizedContentsSize(int col_resource_id,
39 int row_resource_id) {
40 return gfx::Size(GetLocalizedContentsWidth(col_resource_id),
41 GetLocalizedContentsHeight(row_resource_id));
42 }
43
44 } // namespace views
OLDNEW
« no previous file with comments | « views/window/dialog_client_view.cc ('k') | views/window/window_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698