- add sources.
[platform/framework/web/crosswalk.git] / src / printing / backend / print_backend.cc
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "printing/backend/print_backend.h"
6
7 #include <algorithm>
8
9 #include "third_party/icu/source/common/unicode/uchar.h"
10 #include "ui/gfx/text_elider.h"
11
12 const int kMaxDocumentTitleLength = 50;
13
14 namespace printing {
15
16 PrinterBasicInfo::PrinterBasicInfo()
17     : printer_status(0),
18       is_default(false) {}
19
20 PrinterBasicInfo::~PrinterBasicInfo() {}
21
22 PrinterSemanticCapsAndDefaults::PrinterSemanticCapsAndDefaults()
23     : color_changeable(false),
24       duplex_capable(false),
25       color_default(false),
26       duplex_default(UNKNOWN_DUPLEX_MODE) {}
27
28 PrinterSemanticCapsAndDefaults::~PrinterSemanticCapsAndDefaults() {}
29
30 PrinterCapsAndDefaults::PrinterCapsAndDefaults() {}
31
32 PrinterCapsAndDefaults::~PrinterCapsAndDefaults() {}
33
34 PrintBackend::~PrintBackend() {}
35
36 base::string16 PrintBackend::SimplifyDocumentTitle(
37     const base::string16& title) {
38   base::string16 no_controls(title);
39   no_controls.erase(
40     std::remove_if(no_controls.begin(), no_controls.end(), &u_iscntrl),
41     no_controls.end());
42   base::string16 result;
43   gfx::ElideString(no_controls, kMaxDocumentTitleLength, &result);
44   return result;
45 }
46
47 }  // namespace printing