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

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_data_source.h

Issue 10873097: Merge 153342 - Print preview: Use an ID instead of memory pointer string in WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1229/src/
Patch Set: Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DATA_SOURCE_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DATA_SOURCE_H_
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DATA_SOURCE_H_ 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DATA_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 11 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
12 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 12 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
13 13
14 // PrintPreviewDataSource serves data for chrome://print requests. 14 // PrintPreviewDataSource serves data for chrome://print requests.
15 // 15 //
16 // The format for requesting PDF data is as follows: 16 // The format for requesting PDF data is as follows:
17 // chrome://print/<PrintPreviewUIAddrStr>/<PageIndex>/print.pdf 17 // chrome://print/<PrintPreviewUIID>/<PageIndex>/print.pdf
18 // 18 //
19 // Parameters (< > required): 19 // Parameters (< > required):
20 // <PrintPreviewUIAddrStr> = Print preview UI identifier. 20 // <PrintPreviewUIID> = PrintPreview UI ID
21 // <PageIndex> = Page index is zero-based or 21 // <PageIndex> = Page index is zero-based or
22 // |printing::COMPLETE_PREVIEW_DOCUMENT_INDEX| to represent 22 // |printing::COMPLETE_PREVIEW_DOCUMENT_INDEX| to represent
23 // a print ready PDF. 23 // a print ready PDF.
24 // 24 //
25 // Example: 25 // Example:
26 // chrome://print/0xab0123ef/10/print.pdf 26 // chrome://print/123/10/print.pdf
27 // 27 //
28 // Requests to chrome://print with paths not ending in /print.pdf are used 28 // Requests to chrome://print with paths not ending in /print.pdf are used
29 // to return the markup or other resources for the print preview page itself. 29 // to return the markup or other resources for the print preview page itself.
30 class PrintPreviewDataSource : public ChromeWebUIDataSource { 30 class PrintPreviewDataSource : public ChromeWebUIDataSource {
31 public: 31 public:
32 PrintPreviewDataSource(); 32 PrintPreviewDataSource();
33 33
34 // ChromeURLDataManager::DataSource implementation. 34 // ChromeURLDataManager::DataSource implementation.
35 virtual void StartDataRequest(const std::string& path, 35 virtual void StartDataRequest(const std::string& path,
36 bool is_incognito, 36 bool is_incognito,
37 int request_id) OVERRIDE; 37 int request_id) OVERRIDE;
38
38 private: 39 private:
39 virtual ~PrintPreviewDataSource(); 40 virtual ~PrintPreviewDataSource();
40 void Init(); 41 void Init();
41 42
42 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDataSource); 43 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDataSource);
43 }; 44 };
44 45
45 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DATA_SOURCE_H_ 46 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_DATA_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698