| 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_
|
|
|