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

Side by Side Diff: chrome/browser/printing/print_dialog_cloud.cc

Issue 9015022: Replace most of Browser::GetSelectedTabContents calls into Browser::GetSelectedWebContents. I've ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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) 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/printing/print_dialog_cloud.h" 5 #include "chrome/browser/printing/print_dialog_cloud.h"
6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h"
7 7
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 bool delete_on_close) { 597 bool delete_on_close) {
598 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 598 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
599 Browser* browser = BrowserList::GetLastActive(); 599 Browser* browser = BrowserList::GetLastActive();
600 600
601 const int kDefaultWidth = 497; 601 const int kDefaultWidth = 497;
602 const int kDefaultHeight = 332; 602 const int kDefaultHeight = 332;
603 string16 job_title = print_job_title; 603 string16 job_title = print_job_title;
604 Profile* profile = NULL; 604 Profile* profile = NULL;
605 if (modal) { 605 if (modal) {
606 if (job_title.empty()) { 606 if (job_title.empty()) {
607 WebContents* web_contents = 607 WebContents* web_contents = browser->GetSelectedWebContents();
608 browser->GetSelectedTabContentsWrapper()->web_contents();
609 if (web_contents) 608 if (web_contents)
610 job_title = web_contents->GetTitle(); 609 job_title = web_contents->GetTitle();
611 } 610 }
612 profile = browser->GetProfile(); 611 profile = browser->GetProfile();
613 } else { 612 } else {
614 std::vector<Profile*> loaded_profiles = 613 std::vector<Profile*> loaded_profiles =
615 g_browser_process->profile_manager()->GetLoadedProfiles(); 614 g_browser_process->profile_manager()->GetLoadedProfiles();
616 DCHECK_GT(loaded_profiles.size(), 0U); 615 DCHECK_GT(loaded_profiles.size(), 0U);
617 profile = loaded_profiles[0]; 616 profile = loaded_profiles[0];
618 } 617 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 file_type, 723 file_type,
725 false, 724 false,
726 delete_on_close); 725 delete_on_close);
727 return true; 726 return true;
728 } 727 }
729 } 728 }
730 return false; 729 return false;
731 } 730 }
732 731
733 } // end namespace 732 } // end namespace
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/browser/printing/print_dialog_cloud_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698