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/remoting/setup_flow.h" | 5 #include "chrome/browser/remoting/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 23 matching lines...) Expand all Loading... |
34 SetupFlow::SetupFlow(const std::string& args, Profile* profile) | 34 SetupFlow::SetupFlow(const std::string& args, Profile* profile) |
35 : dialog_start_args_(args), | 35 : dialog_start_args_(args), |
36 profile_(profile) { | 36 profile_(profile) { |
37 } | 37 } |
38 | 38 |
39 SetupFlow::~SetupFlow() { | 39 SetupFlow::~SetupFlow() { |
40 } | 40 } |
41 | 41 |
42 void SetupFlow::GetDialogSize(gfx::Size* size) const { | 42 void SetupFlow::GetDialogSize(gfx::Size* size) const { |
43 PrefService* prefs = profile_->GetPrefs(); | 43 PrefService* prefs = profile_->GetPrefs(); |
44 gfx::Font approximate_web_font = gfx::Font::CreateFont( | 44 gfx::Font approximate_web_font( |
45 UTF8ToWide(prefs->GetString(prefs::kWebKitSansSerifFontFamily)), | 45 UTF8ToWide(prefs->GetString(prefs::kWebKitSansSerifFontFamily)), |
46 prefs->GetInteger(prefs::kWebKitDefaultFontSize)); | 46 prefs->GetInteger(prefs::kWebKitDefaultFontSize)); |
47 | 47 |
48 // TODO(pranavk) Replace the following SYNC resources with REMOTING Resources. | 48 // TODO(pranavk) Replace the following SYNC resources with REMOTING Resources. |
49 *size = gfx::GetLocalizedContentsSizeForFont( | 49 *size = gfx::GetLocalizedContentsSizeForFont( |
50 IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS, | 50 IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS, |
51 IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES, | 51 IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES, |
52 approximate_web_font); | 52 approximate_web_font); |
53 } | 53 } |
54 | 54 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 if (b) { | 88 if (b) { |
89 b->BrowserShowHtmlDialog(flow, NULL); | 89 b->BrowserShowHtmlDialog(flow, NULL); |
90 } else { | 90 } else { |
91 delete flow; | 91 delete flow; |
92 return NULL; | 92 return NULL; |
93 } | 93 } |
94 return flow; | 94 return flow; |
95 } | 95 } |
96 | 96 |
97 } // namespace remoting_setup | 97 } // namespace remoting_setup |
OLD | NEW |