OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/printing/cloud_print/cloud_print_setup_flow.h" | 5 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/singleton.h" | 8 #include "base/singleton.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 *size = ui::GetLocalizedContentsSizeForFont( | 125 *size = ui::GetLocalizedContentsSizeForFont( |
126 IDS_CLOUD_PRINT_SETUP_WIZARD_DONE_WIDTH_CHARS, | 126 IDS_CLOUD_PRINT_SETUP_WIZARD_DONE_WIDTH_CHARS, |
127 IDS_CLOUD_PRINT_SETUP_WIZARD_DONE_HEIGHT_LINES, | 127 IDS_CLOUD_PRINT_SETUP_WIZARD_DONE_HEIGHT_LINES, |
128 approximate_web_font); | 128 approximate_web_font); |
129 } else { | 129 } else { |
130 *size = ui::GetLocalizedContentsSizeForFont( | 130 *size = ui::GetLocalizedContentsSizeForFont( |
131 IDS_CLOUD_PRINT_SETUP_WIZARD_WIDTH_CHARS, | 131 IDS_CLOUD_PRINT_SETUP_WIZARD_WIDTH_CHARS, |
132 IDS_CLOUD_PRINT_SETUP_WIZARD_HEIGHT_LINES, | 132 IDS_CLOUD_PRINT_SETUP_WIZARD_HEIGHT_LINES, |
133 approximate_web_font); | 133 approximate_web_font); |
134 } | 134 } |
135 | |
136 #if !defined(OS_WIN) | |
csilv
2011/02/18 22:11:55
You may want to add a comment describing why this
| |
137 float scale_hack = 96.f/72.f; | |
138 size->set_width(size->width() * scale_hack); | |
139 size->set_height(size->height() * scale_hack); | |
140 #endif | |
135 } | 141 } |
136 | 142 |
137 // A callback to notify the delegate that the dialog closed. | 143 // A callback to notify the delegate that the dialog closed. |
138 void CloudPrintSetupFlow::OnDialogClosed(const std::string& json_retval) { | 144 void CloudPrintSetupFlow::OnDialogClosed(const std::string& json_retval) { |
139 // If we are fetching the token then cancel the request. | 145 // If we are fetching the token then cancel the request. |
140 if (authenticator_.get()) | 146 if (authenticator_.get()) |
141 authenticator_->CancelRequest(); | 147 authenticator_->CancelRequest(); |
142 | 148 |
143 if (delegate_) { | 149 if (delegate_) { |
144 delegate_->OnDialogClosed(); | 150 delegate_->OnDialogClosed(); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 | 291 |
286 void CloudPrintSetupFlow::ExecuteJavascriptInIFrame( | 292 void CloudPrintSetupFlow::ExecuteJavascriptInIFrame( |
287 const std::wstring& iframe_xpath, | 293 const std::wstring& iframe_xpath, |
288 const std::wstring& js) { | 294 const std::wstring& js) { |
289 if (web_ui_) { | 295 if (web_ui_) { |
290 RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); | 296 RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); |
291 rvh->ExecuteJavascriptInWebFrame(WideToUTF16Hack(iframe_xpath), | 297 rvh->ExecuteJavascriptInWebFrame(WideToUTF16Hack(iframe_xpath), |
292 WideToUTF16Hack(js)); | 298 WideToUTF16Hack(js)); |
293 } | 299 } |
294 } | 300 } |
OLD | NEW |