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

Side by Side Diff: chrome/browser/ui/webui/print_preview_ui.cc

Issue 8949061: Move a bunch of methods from TabContents into the WebContents interface. This change either moves... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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) 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/ui/webui/print_preview_ui.h" 5 #include "chrome/browser/ui/webui/print_preview_ui.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const std::string& initiator_url, 128 const std::string& initiator_url,
129 const string16& job_title) { 129 const string16& job_title) {
130 initiator_url_ = initiator_url; 130 initiator_url_ = initiator_url;
131 initiator_tab_title_ = job_title; 131 initiator_tab_title_ = job_title;
132 } 132 }
133 133
134 // static 134 // static
135 void PrintPreviewUI::SetSourceIsModifiable( 135 void PrintPreviewUI::SetSourceIsModifiable(
136 TabContentsWrapper* print_preview_tab, 136 TabContentsWrapper* print_preview_tab,
137 bool source_is_modifiable) { 137 bool source_is_modifiable) {
138 if (!print_preview_tab || !print_preview_tab->tab_contents()->web_ui()) 138 if (!print_preview_tab || !print_preview_tab->tab_contents()->GetWebUI())
139 return; 139 return;
140 PrintPreviewUI* print_preview_ui = 140 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
141 static_cast<PrintPreviewUI*>(print_preview_tab->tab_contents()->web_ui()); 141 print_preview_tab->tab_contents()->GetWebUI());
142 print_preview_ui->source_is_modifiable_ = source_is_modifiable; 142 print_preview_ui->source_is_modifiable_ = source_is_modifiable;
143 } 143 }
144 144
145 // static 145 // static
146 void PrintPreviewUI::GetCurrentPrintPreviewStatus( 146 void PrintPreviewUI::GetCurrentPrintPreviewStatus(
147 const std::string& preview_ui_addr, 147 const std::string& preview_ui_addr,
148 int request_id, 148 int request_id,
149 bool* cancel) { 149 bool* cancel) {
150 int current_id = -1; 150 int current_id = -1;
151 if (!g_print_preview_request_id_map.Get().Get(preview_ui_addr, &current_id)) { 151 if (!g_print_preview_request_id_map.Get().Get(preview_ui_addr, &current_id)) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 ConstrainedHtmlUIDelegate* delegate = GetConstrainedDelegate(); 302 ConstrainedHtmlUIDelegate* delegate = GetConstrainedDelegate();
303 if (!delegate) 303 if (!delegate)
304 return; 304 return;
305 delegate->GetHtmlDialogUIDelegate()->OnDialogClosed(""); 305 delegate->GetHtmlDialogUIDelegate()->OnDialogClosed("");
306 delegate->OnDialogCloseFromWebUI(); 306 delegate->OnDialogCloseFromWebUI();
307 } 307 }
308 308
309 void PrintPreviewUI::OnReloadPrintersList() { 309 void PrintPreviewUI::OnReloadPrintersList() {
310 CallJavascriptFunction("reloadPrintersList"); 310 CallJavascriptFunction("reloadPrintersList");
311 } 311 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/print_preview_handler_unittest.cc ('k') | chrome/browser/ui/webui/print_preview_ui_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698