| 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/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  Loading... | 
| 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  Loading... | 
| 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 } | 
| OLD | NEW | 
|---|