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

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

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the previous fix Created 9 years, 8 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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 job_title = browser->GetSelectedTabContents()->GetTitle(); 538 job_title = browser->GetSelectedTabContents()->GetTitle();
539 profile = browser->GetProfile(); 539 profile = browser->GetProfile();
540 } else { 540 } else {
541 profile = ProfileManager::GetDefaultProfile(); 541 profile = ProfileManager::GetDefaultProfile();
542 } 542 }
543 DCHECK(profile); 543 DCHECK(profile);
544 PrefService* pref_service = profile->GetPrefs(); 544 PrefService* pref_service = profile->GetPrefs();
545 DCHECK(pref_service); 545 DCHECK(pref_service);
546 if (!pref_service->FindPreference(prefs::kCloudPrintDialogWidth)) { 546 if (!pref_service->FindPreference(prefs::kCloudPrintDialogWidth)) {
547 pref_service->RegisterIntegerPref(prefs::kCloudPrintDialogWidth, 547 pref_service->RegisterIntegerPref(prefs::kCloudPrintDialogWidth,
548 kDefaultWidth); 548 kDefaultWidth,
549 false /* don't sync pref */);
549 } 550 }
550 if (!pref_service->FindPreference(prefs::kCloudPrintDialogHeight)) { 551 if (!pref_service->FindPreference(prefs::kCloudPrintDialogHeight)) {
551 pref_service->RegisterIntegerPref(prefs::kCloudPrintDialogHeight, 552 pref_service->RegisterIntegerPref(prefs::kCloudPrintDialogHeight,
552 kDefaultHeight); 553 kDefaultHeight,
554 false /* don't sync pref */);
553 } 555 }
554 556
555 int width = pref_service->GetInteger(prefs::kCloudPrintDialogWidth); 557 int width = pref_service->GetInteger(prefs::kCloudPrintDialogWidth);
556 int height = pref_service->GetInteger(prefs::kCloudPrintDialogHeight); 558 int height = pref_service->GetInteger(prefs::kCloudPrintDialogHeight);
557 559
558 HtmlDialogUIDelegate* dialog_delegate = 560 HtmlDialogUIDelegate* dialog_delegate =
559 new internal_cloud_print_helpers::CloudPrintHtmlDialogDelegate( 561 new internal_cloud_print_helpers::CloudPrintHtmlDialogDelegate(
560 path_to_file, width, height, std::string(), job_title, file_type, 562 path_to_file, width, height, std::string(), job_title, file_type,
561 modal); 563 modal);
562 if (modal) { 564 if (modal) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 print_job_title, 627 print_job_title,
626 file_type, 628 file_type,
627 false); 629 false);
628 return true; 630 return true;
629 } 631 }
630 } 632 }
631 return false; 633 return false;
632 } 634 }
633 635
634 } // end namespace 636 } // end namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698