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 "printing/print_settings_initializer.h" | 5 #include "printing/print_settings_initializer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/i18n/time_formatting.h" | 11 #include "base/i18n/time_formatting.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "printing/print_job_constants.h" | 16 #include "printing/print_job_constants.h" |
17 #include "printing/print_settings.h" | 17 #include "printing/print_settings.h" |
18 #include "printing/units.h" | 18 #include "printing/units.h" |
19 #include "ui/base/text/text_elider.h" | 19 #include "ui/base/text/text_elider.h" |
| 20 #include "ui/gfx/font.h" |
20 #include "url/gurl.h" | 21 #include "url/gurl.h" |
21 | 22 |
22 using base::DictionaryValue; | 23 using base::DictionaryValue; |
23 | 24 |
24 namespace printing { | 25 namespace printing { |
25 | 26 |
26 void PrintSettingsInitializer::InitHeaderFooterStrings( | 27 void PrintSettingsInitializer::InitHeaderFooterStrings( |
27 const DictionaryValue& job_settings, | 28 const DictionaryValue& job_settings, |
28 PrintSettings* print_settings) { | 29 PrintSettings* print_settings) { |
29 if (!job_settings.GetBoolean(kSettingHeaderFooterEnabled, | 30 if (!job_settings.GetBoolean(kSettingHeaderFooterEnabled, |
(...skipping 10 matching lines...) Expand all Loading... |
40 !job_settings.GetString(kSettingHeaderFooterURL, &url)) { | 41 !job_settings.GetString(kSettingHeaderFooterURL, &url)) { |
41 NOTREACHED(); | 42 NOTREACHED(); |
42 } | 43 } |
43 | 44 |
44 print_settings->date = date; | 45 print_settings->date = date; |
45 print_settings->title = title; | 46 print_settings->title = title; |
46 print_settings->url = ui::ElideUrl(GURL(url), gfx::Font(), 0, std::string()); | 47 print_settings->url = ui::ElideUrl(GURL(url), gfx::Font(), 0, std::string()); |
47 } | 48 } |
48 | 49 |
49 } // namespace printing | 50 } // namespace printing |
OLD | NEW |