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

Side by Side Diff: chrome/browser/dom_ui/print_preview_ui.cc

Issue 6461024: Revert 74292 - Splits ChromeURLDataManager into 2 chunks:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | « chrome/browser/dom_ui/plugins_ui.cc ('k') | chrome/browser/dom_ui/remoting_ui.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) 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/dom_ui/print_preview_ui.h" 5 #include "chrome/browser/dom_ui/print_preview_ui.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/browser_thread.h" 8 #include "chrome/browser/browser_thread.h"
9 #include "chrome/browser/dom_ui/print_preview_handler.h" 9 #include "chrome/browser/dom_ui/print_preview_handler.h"
10 #include "chrome/browser/dom_ui/print_preview_ui_html_source.h" 10 #include "chrome/browser/dom_ui/print_preview_ui_html_source.h"
11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/tab_contents/tab_contents.h"
13 11
14 PrintPreviewUI::PrintPreviewUI(TabContents* contents) 12 PrintPreviewUI::PrintPreviewUI(TabContents* contents)
15 : DOMUI(contents), 13 : DOMUI(contents),
16 html_source_(new PrintPreviewUIHTMLSource()) { 14 html_source_(new PrintPreviewUIHTMLSource()) {
17 // PrintPreviewUI owns |handler|. 15 // PrintPreviewUI owns |handler|.
18 PrintPreviewHandler* handler = new PrintPreviewHandler(); 16 PrintPreviewHandler* handler = new PrintPreviewHandler();
19 AddMessageHandler(handler->Attach(this)); 17 AddMessageHandler(handler->Attach(this));
20 18
21 // Set up the chrome://print/ source. 19 // Set up the chrome://print/ source.
22 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source_); 20 BrowserThread::PostTask(
21 BrowserThread::IO, FROM_HERE,
22 NewRunnableMethod(
23 ChromeURLDataManager::GetInstance(),
24 &ChromeURLDataManager::AddDataSource,
25 html_source_));
23 } 26 }
24 27
25 PrintPreviewUI::~PrintPreviewUI() { 28 PrintPreviewUI::~PrintPreviewUI() {
26 } 29 }
27 30
28 PrintPreviewUIHTMLSource* PrintPreviewUI::html_source() { 31 PrintPreviewUIHTMLSource* PrintPreviewUI::html_source() {
29 return html_source_.get(); 32 return html_source_.get();
30 } 33 }
31 34
32 void PrintPreviewUI::PreviewDataIsAvailable() { 35 void PrintPreviewUI::PreviewDataIsAvailable() {
33 StringValue dummy_url("chrome://print/print.pdf"); 36 StringValue dummy_url("chrome://print/print.pdf");
34 CallJavascriptFunction(L"createPDFPlugin", dummy_url); 37 CallJavascriptFunction(L"createPDFPlugin", dummy_url);
35 } 38 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/plugins_ui.cc ('k') | chrome/browser/dom_ui/remoting_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698