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

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

Issue 8892011: Clean up TCW, make it solely a hub for 1:1 observer/helper objects. (Closed) Base URL: svn://svn.chromium.org/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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, &current_id)) { 142 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
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 }
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