Index: chrome/browser/ui/webui/print_preview_ui.cc |
diff --git a/chrome/browser/ui/webui/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview_ui.cc |
index 89bcab0bd9760b9878a2cc0afb779242bbf40abc..339a5067388ae5f9122bab8870fee0247749751a 100644 |
--- a/chrome/browser/ui/webui/print_preview_ui.cc |
+++ b/chrome/browser/ui/webui/print_preview_ui.cc |
@@ -16,9 +16,9 @@ |
PrintPreviewUI::PrintPreviewUI(TabContents* contents) |
: ChromeWebUI(contents), |
initial_preview_start_time_(base::TimeTicks::Now()) { |
- // PrintPreviewUI owns |handler|. |
- PrintPreviewHandler* handler = new PrintPreviewHandler(); |
- AddMessageHandler(handler->Attach(this)); |
+ // WebUI owns |handler_|. |
+ handler_ = new PrintPreviewHandler(); |
+ AddMessageHandler(handler_->Attach(this)); |
// Set up the chrome://print/ data source. |
contents->profile()->GetChromeURLDataManager()->AddDataSource( |
@@ -69,6 +69,10 @@ void PrintPreviewUI::OnPreviewDataIsAvailable(int expected_pages_count, |
is_preview_modifiable, ui_identifier); |
} |
+void PrintPreviewUI::OnNavigation() { |
+ handler_->OnNavigation(); |
+} |
+ |
void PrintPreviewUI::OnFileSelectionCancelled() { |
CallJavascriptFunction("fileSelectionCancelled"); |
} |