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

Side by Side Diff: chrome/browser/sync/sync_setup_flow.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « chrome/browser/remoting/setup_flow.cc ('k') | chrome/browser/views/about_chrome_view.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/sync/sync_setup_flow.h" 5 #include "chrome/browser/sync/sync_setup_flow.h"
6 6
7 #include "app/gfx/font_util.h" 7 #include "app/gfx/font_util.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/histogram.h" 9 #include "base/histogram.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 SyncSetupFlow::~SyncSetupFlow() { 247 SyncSetupFlow::~SyncSetupFlow() {
248 flow_handler_->set_flow(NULL); 248 flow_handler_->set_flow(NULL);
249 if (owns_flow_handler_) { 249 if (owns_flow_handler_) {
250 delete flow_handler_; 250 delete flow_handler_;
251 } 251 }
252 } 252 }
253 253
254 void SyncSetupFlow::GetDialogSize(gfx::Size* size) const { 254 void SyncSetupFlow::GetDialogSize(gfx::Size* size) const {
255 PrefService* prefs = service_->profile()->GetPrefs(); 255 PrefService* prefs = service_->profile()->GetPrefs();
256 gfx::Font approximate_web_font = gfx::Font::CreateFont( 256 gfx::Font approximate_web_font = gfx::Font(
257 UTF8ToWide(prefs->GetString(prefs::kWebKitSansSerifFontFamily)), 257 UTF8ToWide(prefs->GetString(prefs::kWebKitSansSerifFontFamily)),
258 prefs->GetInteger(prefs::kWebKitDefaultFontSize)); 258 prefs->GetInteger(prefs::kWebKitDefaultFontSize));
259 259
260 *size = gfx::GetLocalizedContentsSizeForFont( 260 *size = gfx::GetLocalizedContentsSizeForFont(
261 IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS, 261 IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS,
262 IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES, 262 IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES,
263 approximate_web_font); 263 approximate_web_font);
264 264
265 #if defined(OS_MACOSX) 265 #if defined(OS_MACOSX)
266 // NOTE(akalin): This is a hack to work around a problem with font height on 266 // NOTE(akalin): This is a hack to work around a problem with font height on
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 Browser* b = BrowserList::GetLastActive(); 496 Browser* b = BrowserList::GetLastActive();
497 if (b) { 497 if (b) {
498 b->BrowserShowHtmlDialog(flow, parent_window); 498 b->BrowserShowHtmlDialog(flow, parent_window);
499 } else { 499 } else {
500 delete flow; 500 delete flow;
501 return NULL; 501 return NULL;
502 } 502 }
503 #endif // defined(OS_MACOSX) 503 #endif // defined(OS_MACOSX)
504 return flow; 504 return flow;
505 } 505 }
OLDNEW
« no previous file with comments | « chrome/browser/remoting/setup_flow.cc ('k') | chrome/browser/views/about_chrome_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698