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

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

Issue 22882007: Remove GetActiveEntry usage from chrome/browser/ui. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on ToT. Created 7 years, 2 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 10
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 // headers and footers are to be displayed. 445 // headers and footers are to be displayed.
446 bool display_header_footer = false; 446 bool display_header_footer = false;
447 if (!settings->GetBoolean(printing::kSettingHeaderFooterEnabled, 447 if (!settings->GetBoolean(printing::kSettingHeaderFooterEnabled,
448 &display_header_footer)) { 448 &display_header_footer)) {
449 NOTREACHED(); 449 NOTREACHED();
450 } 450 }
451 if (display_header_footer) { 451 if (display_header_footer) {
452 settings->SetString(printing::kSettingHeaderFooterTitle, 452 settings->SetString(printing::kSettingHeaderFooterTitle,
453 initiator->GetTitle()); 453 initiator->GetTitle());
454 std::string url; 454 std::string url;
455 NavigationEntry* entry = initiator->GetController().GetActiveEntry(); 455 NavigationEntry* entry = initiator->GetController().GetLastCommittedEntry();
456 if (entry) 456 if (entry)
457 url = entry->GetVirtualURL().spec(); 457 url = entry->GetVirtualURL().spec();
458 settings->SetString(printing::kSettingHeaderFooterURL, url); 458 settings->SetString(printing::kSettingHeaderFooterURL, url);
459 } 459 }
460 460
461 bool generate_draft_data = false; 461 bool generate_draft_data = false;
462 bool success = settings->GetBoolean(printing::kSettingGenerateDraftData, 462 bool success = settings->GetBoolean(printing::kSettingGenerateDraftData,
463 &generate_draft_data); 463 &generate_draft_data);
464 DCHECK(success); 464 DCHECK(success);
465 465
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 if (!tmp_data.get()) { 1067 if (!tmp_data.get()) {
1068 // Nothing to print, no preview available. 1068 // Nothing to print, no preview available.
1069 return false; 1069 return false;
1070 } 1070 }
1071 DCHECK(tmp_data->size() && tmp_data->front()); 1071 DCHECK(tmp_data->size() && tmp_data->front());
1072 1072
1073 *data = tmp_data; 1073 *data = tmp_data;
1074 *title = print_preview_ui->initiator_title(); 1074 *title = print_preview_ui->initiator_title();
1075 return true; 1075 return true;
1076 } 1076 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/suggestions_page_handler.cc ('k') | chrome/browser/ui/zoom/zoom_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698