Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1007)

Side by Side Diff: chrome/browser/printing/page_range.h

Issue 125082: Add Print Selection support to Chrome. This change is fairly involved since ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/printing/page_range.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_PRINTING_PAGE_RANGE_H__ 5 #ifndef CHROME_BROWSER_PRINTING_PAGE_RANGE_H__
6 #define CHROME_BROWSER_PRINTING_PAGE_RANGE_H__ 6 #define CHROME_BROWSER_PRINTING_PAGE_RANGE_H__
7 7
8 #include <vector> 8 #include <vector>
9 9
10 namespace printing { 10 namespace printing {
11 11
12 struct PageRange; 12 struct PageRange;
13 13
14 typedef std::vector<PageRange> PageRanges; 14 typedef std::vector<PageRange> PageRanges;
15 15
16 // Print range is inclusive. To select one page, set from == to. 16 // Print range is inclusive. To select one page, set from == to.
17 struct PageRange { 17 struct PageRange {
18 int from; 18 int from;
19 int to; 19 int to;
20 20
21 bool operator==(const PageRange& rhs) const { 21 bool operator==(const PageRange& rhs) const {
22 return from == rhs.from && to == rhs.to; 22 return from == rhs.from && to == rhs.to;
23 } 23 }
24 24
25 // Retrieves the sorted list of unique pages in the page ranges. 25 // Retrieves the sorted list of unique pages in the page ranges.
26 static std::vector<int> GetPages(const PageRanges& ranges); 26 static std::vector<int> GetPages(const PageRanges& ranges);
27
28 // Gets the total number of pages.
29 static int GetTotalPages(const PageRanges& ranges);
27 }; 30 };
28 31
29 } // namespace printing 32 } // namespace printing
30 33
31 #endif // CHROME_BROWSER_PRINTING_PAGE_RANGE_H__ 34 #endif // CHROME_BROWSER_PRINTING_PAGE_RANGE_H__
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/page_range.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698