OLD | NEW |
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 const std::string& initiator_url, | 119 const std::string& initiator_url, |
120 const string16& job_title) { | 120 const string16& job_title) { |
121 initiator_url_ = initiator_url; | 121 initiator_url_ = initiator_url; |
122 initiator_tab_title_ = job_title; | 122 initiator_tab_title_ = job_title; |
123 } | 123 } |
124 | 124 |
125 // static | 125 // static |
126 void PrintPreviewUI::SetSourceIsModifiable( | 126 void PrintPreviewUI::SetSourceIsModifiable( |
127 TabContentsWrapper* print_preview_tab, | 127 TabContentsWrapper* print_preview_tab, |
128 bool source_is_modifiable) { | 128 bool source_is_modifiable) { |
129 if (!print_preview_tab || !print_preview_tab->web_ui()) | 129 if (!print_preview_tab || !print_preview_tab->tab_contents()->web_ui()) |
130 return; | 130 return; |
131 PrintPreviewUI* print_preview_ui = | 131 PrintPreviewUI* print_preview_ui = |
132 static_cast<PrintPreviewUI*>(print_preview_tab->web_ui()); | 132 static_cast<PrintPreviewUI*>(print_preview_tab->tab_contents()->web_ui()); |
133 print_preview_ui->source_is_modifiable_ = source_is_modifiable; | 133 print_preview_ui->source_is_modifiable_ = source_is_modifiable; |
134 } | 134 } |
135 | 135 |
136 // static | 136 // static |
137 void PrintPreviewUI::GetCurrentPrintPreviewStatus( | 137 void PrintPreviewUI::GetCurrentPrintPreviewStatus( |
138 const std::string& preview_ui_addr, | 138 const std::string& preview_ui_addr, |
139 int request_id, | 139 int request_id, |
140 bool* cancel) { | 140 bool* cancel) { |
141 int current_id = -1; | 141 int current_id = -1; |
142 if (!g_print_preview_request_id_map.Get().Get(preview_ui_addr, ¤t_id)) { | 142 if (!g_print_preview_request_id_map.Get().Get(preview_ui_addr, ¤t_id)) { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 ConstrainedHtmlUIDelegate* delegate = GetConstrainedDelegate(); | 293 ConstrainedHtmlUIDelegate* delegate = GetConstrainedDelegate(); |
294 if (!delegate) | 294 if (!delegate) |
295 return; | 295 return; |
296 delegate->GetHtmlDialogUIDelegate()->OnDialogClosed(""); | 296 delegate->GetHtmlDialogUIDelegate()->OnDialogClosed(""); |
297 delegate->OnDialogCloseFromWebUI(); | 297 delegate->OnDialogCloseFromWebUI(); |
298 } | 298 } |
299 | 299 |
300 void PrintPreviewUI::OnReloadPrintersList() { | 300 void PrintPreviewUI::OnReloadPrintersList() { |
301 CallJavascriptFunction("reloadPrintersList"); | 301 CallJavascriptFunction("reloadPrintersList"); |
302 } | 302 } |
OLD | NEW |