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

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 10873097: Merge 153342 - Print preview: Use an ID instead of memory pointer string in WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1229/src/
Patch Set: Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/print_preview_handler.h" 5 #include "chrome/browser/ui/webui/print_preview/print_preview_handler.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 int request_id = -1; 336 int request_id = -1;
337 if (!settings->GetInteger(printing::kPreviewRequestID, &request_id)) 337 if (!settings->GetInteger(printing::kPreviewRequestID, &request_id))
338 return; 338 return;
339 339
340 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( 340 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
341 web_ui()->GetController()); 341 web_ui()->GetController());
342 print_preview_ui->OnPrintPreviewRequest(request_id); 342 print_preview_ui->OnPrintPreviewRequest(request_id);
343 // Add an additional key in order to identify |print_preview_ui| later on 343 // Add an additional key in order to identify |print_preview_ui| later on
344 // when calling PrintPreviewUI::GetCurrentPrintPreviewStatus() on the IO 344 // when calling PrintPreviewUI::GetCurrentPrintPreviewStatus() on the IO
345 // thread. 345 // thread.
346 settings->SetString(printing::kPreviewUIAddr, 346 settings->SetInteger(printing::kPreviewUIID,
347 print_preview_ui->GetPrintPreviewUIAddress()); 347 print_preview_ui->GetIDForPrintPreviewUI());
348 348
349 // Increment request count. 349 // Increment request count.
350 ++regenerate_preview_request_count_; 350 ++regenerate_preview_request_count_;
351 351
352 TabContents* initiator_tab = GetInitiatorTab(); 352 TabContents* initiator_tab = GetInitiatorTab();
353 if (!initiator_tab) { 353 if (!initiator_tab) {
354 ReportUserActionHistogram(INITIATOR_TAB_CLOSED); 354 ReportUserActionHistogram(INITIATOR_TAB_CLOSED);
355 print_preview_ui->OnClosePrintPreviewTab(); 355 print_preview_ui->OnClosePrintPreviewTab();
356 return; 356 return;
357 } 357 }
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 return; 969 return;
970 970
971 // We no longer require the initiator tab details. Remove those details 971 // We no longer require the initiator tab details. Remove those details
972 // associated with the preview tab to allow the initiator tab to create 972 // associated with the preview tab to allow the initiator tab to create
973 // another preview tab. 973 // another preview tab.
974 printing::PrintPreviewTabController* tab_controller = 974 printing::PrintPreviewTabController* tab_controller =
975 printing::PrintPreviewTabController::GetInstance(); 975 printing::PrintPreviewTabController::GetInstance();
976 if (tab_controller) 976 if (tab_controller)
977 tab_controller->EraseInitiatorTabInfo(preview_tab_contents()); 977 tab_controller->EraseInitiatorTabInfo(preview_tab_contents());
978 } 978 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698