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

Unified Diff: chrome/browser/printing/cloud_print/cloud_print_setup_handler.h

Issue 6685008: Cloud print signin crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase past Windows views options removal. Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/printing/cloud_print/cloud_print_setup_handler.h
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_handler.h b/chrome/browser/printing/cloud_print/cloud_print_setup_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..4831ccecb30256e6baa9bf323bab805b141e30ac
--- /dev/null
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_handler.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_HANDLER_H_
+#define CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_HANDLER_H_
+#pragma once
+
+#include "base/weak_ptr.h"
+#include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h"
+
+// Cloud Print setup handler.
+// Provides a weak pointer adapter so that callers of
+// CloudPrintSetupFlow::OpenDialog can still be notified when the dialog
+// completes, but don't have to stick around until the end. Lifetime should be
+// shorter than that of it's owner.
+class CloudPrintSetupHandler
+ : public CloudPrintSetupFlow::Delegate,
+ public base::SupportsWeakPtr<CloudPrintSetupHandler> {
+ public:
+ class Delegate {
+ public:
+ virtual ~Delegate() {}
+ // Called when the setup dialog is closed.
+ virtual void OnCloudPrintSetupClosed() = 0;
+ };
+
+ explicit CloudPrintSetupHandler(Delegate* handler);
+ virtual ~CloudPrintSetupHandler();
+
+ // CloudPrintSetupFlow::Delegate implementation.
+ virtual void OnDialogClosed();
+
+ private:
+ Delegate* handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(CloudPrintSetupHandler);
+};
+
+#endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698