OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/window/window_win.h" | 5 #include "views/window/window_win.h" |
6 | 6 |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 | 8 |
9 #include "app/gfx/chrome_canvas.h" | 9 #include "app/gfx/chrome_canvas.h" |
10 #include "app/gfx/chrome_font.h" | 10 #include "app/gfx/chrome_font.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 if (--force_hidden_count_ <= 0) { | 179 if (--force_hidden_count_ <= 0) { |
180 force_hidden_count_ = 0; | 180 force_hidden_count_ = 0; |
181 ShowWindow(SW_SHOW); | 181 ShowWindow(SW_SHOW); |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 // static | 185 // static |
186 int Window::GetLocalizedContentsWidth(int col_resource_id) { | 186 int Window::GetLocalizedContentsWidth(int col_resource_id) { |
187 double chars = _wtof(l10n_util::GetString(col_resource_id).c_str()); | 187 double chars = _wtof(l10n_util::GetString(col_resource_id).c_str()); |
188 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 188 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
189 ChromeFont font = rb.GetFont(ResourceBundle::BaseFont); | 189 gfx::Font font = rb.GetFont(ResourceBundle::BaseFont); |
190 int width = font.GetExpectedTextWidth(static_cast<int>(chars)); | 190 int width = font.GetExpectedTextWidth(static_cast<int>(chars)); |
191 DCHECK(width > 0); | 191 DCHECK(width > 0); |
192 return width; | 192 return width; |
193 } | 193 } |
194 | 194 |
195 // static | 195 // static |
196 int Window::GetLocalizedContentsHeight(int row_resource_id) { | 196 int Window::GetLocalizedContentsHeight(int row_resource_id) { |
197 double lines = _wtof(l10n_util::GetString(row_resource_id).c_str()); | 197 double lines = _wtof(l10n_util::GetString(row_resource_id).c_str()); |
198 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 198 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
199 ChromeFont font = rb.GetFont(ResourceBundle::BaseFont); | 199 gfx::Font font = rb.GetFont(ResourceBundle::BaseFont); |
200 int height = static_cast<int>(font.height() * lines); | 200 int height = static_cast<int>(font.height() * lines); |
201 DCHECK(height > 0); | 201 DCHECK(height > 0); |
202 return height; | 202 return height; |
203 } | 203 } |
204 | 204 |
205 // static | 205 // static |
206 gfx::Size Window::GetLocalizedContentsSize(int col_resource_id, | 206 gfx::Size Window::GetLocalizedContentsSize(int col_resource_id, |
207 int row_resource_id) { | 207 int row_resource_id) { |
208 return gfx::Size(GetLocalizedContentsWidth(col_resource_id), | 208 return gfx::Size(GetLocalizedContentsWidth(col_resource_id), |
209 GetLocalizedContentsHeight(row_resource_id)); | 209 GetLocalizedContentsHeight(row_resource_id)); |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 } | 1371 } |
1372 return TRUE; | 1372 return TRUE; |
1373 } | 1373 } |
1374 } // namespace | 1374 } // namespace |
1375 | 1375 |
1376 void Window::CloseAllSecondaryWindows() { | 1376 void Window::CloseAllSecondaryWindows() { |
1377 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); | 1377 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); |
1378 } | 1378 } |
1379 | 1379 |
1380 } // namespace views | 1380 } // namespace views |
OLD | NEW |