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

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

Issue 176363002: Rename Start/EndKeepAlive to Increment/DecrementKeepAliveCount (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/printing/print_dialog_cloud.h" 5 #include "chrome/browser/printing/print_dialog_cloud.h"
6 6
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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 params_.url = GURL(chrome::kChromeUICloudPrintResourcesURL); 533 params_.url = GURL(chrome::kChromeUICloudPrintResourcesURL);
534 GetDialogWidthAndHeightFromPrefs(browser_context, 534 GetDialogWidthAndHeightFromPrefs(browser_context,
535 &params_.width, 535 &params_.width,
536 &params_.height); 536 &params_.height);
537 params_.json_input = json_arguments; 537 params_.json_input = json_arguments;
538 538
539 flow_handler_->SetDialogDelegate(this); 539 flow_handler_->SetDialogDelegate(this);
540 // If we're not modal we can show the dialog with no browser. 540 // If we're not modal we can show the dialog with no browser.
541 // We need this to keep Chrome alive while our dialog is up. 541 // We need this to keep Chrome alive while our dialog is up.
542 if (!modal_parent_ && keep_alive_when_non_modal_) 542 if (!modal_parent_ && keep_alive_when_non_modal_)
543 chrome::StartKeepAlive(); 543 chrome::IncrementKeepAliveCount();
544 } 544 }
545 545
546 CloudPrintWebDialogDelegate::~CloudPrintWebDialogDelegate() { 546 CloudPrintWebDialogDelegate::~CloudPrintWebDialogDelegate() {
547 // If the flow_handler_ is about to outlive us because we don't own 547 // If the flow_handler_ is about to outlive us because we don't own
548 // it anymore, we need to have it remove its reference to us. 548 // it anymore, we need to have it remove its reference to us.
549 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 549 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
550 flow_handler_->SetDialogDelegate(NULL); 550 flow_handler_->SetDialogDelegate(NULL);
551 if (owns_flow_handler_) { 551 if (owns_flow_handler_) {
552 delete flow_handler_; 552 delete flow_handler_;
553 } 553 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 585
586 void CloudPrintWebDialogDelegate::OnDialogClosed( 586 void CloudPrintWebDialogDelegate::OnDialogClosed(
587 const std::string& json_retval) { 587 const std::string& json_retval) {
588 // Get the final dialog size and store it. 588 // Get the final dialog size and store it.
589 flow_handler_->StoreDialogClientSize(); 589 flow_handler_->StoreDialogClientSize();
590 590
591 // If we're modal we can show the dialog with no browser. 591 // If we're modal we can show the dialog with no browser.
592 // End the keep-alive so that Chrome can exit. 592 // End the keep-alive so that Chrome can exit.
593 if (!modal_parent_ && keep_alive_when_non_modal_) { 593 if (!modal_parent_ && keep_alive_when_non_modal_) {
594 // Post to prevent recursive call tho this function. 594 // Post to prevent recursive call tho this function.
595 base::MessageLoop::current()->PostTask(FROM_HERE, 595 base::MessageLoop::current()->PostTask(
596 base::Bind(&chrome::EndKeepAlive)); 596 FROM_HERE, base::Bind(&chrome::DecrementKeepAliveCount));
597 } 597 }
598 delete this; 598 delete this;
599 } 599 }
600 600
601 void CloudPrintWebDialogDelegate::OnCloseContents(WebContents* source, 601 void CloudPrintWebDialogDelegate::OnCloseContents(WebContents* source,
602 bool* out_close_dialog) { 602 bool* out_close_dialog) {
603 if (out_close_dialog) 603 if (out_close_dialog)
604 *out_close_dialog = true; 604 *out_close_dialog = true;
605 } 605 }
606 606
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 print_job_print_ticket, 772 print_job_print_ticket,
773 file_type, 773 file_type,
774 delete_on_close); 774 delete_on_close);
775 return true; 775 return true;
776 } 776 }
777 } 777 }
778 return false; 778 return false;
779 } 779 }
780 780
781 } // namespace print_dialog_cloud 781 } // namespace print_dialog_cloud
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698