| Index: chrome/browser/ui/screen_capture_confirmation_dialog.h
|
| diff --git a/chrome/browser/ui/screen_capture_confirmation_dialog.h b/chrome/browser/ui/screen_capture_confirmation_dialog.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a4902d1a5aa178d707d16518ee259d5c94d8d186
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/screen_capture_confirmation_dialog.h
|
| @@ -0,0 +1,45 @@
|
| +// Copyright 2013 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_UI_SCREEN_CAPTURE_CONFIRMATION_DIALOG_H_
|
| +#define CHROME_BROWSER_UI_SCREEN_CAPTURE_CONFIRMATION_DIALOG_H_
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/callback.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/string16.h"
|
| +
|
| +// Modal dialog that is used to get user's permissions for screen capture API.
|
| +class ScreenCaptureConfirmationDialog {
|
| + public:
|
| + enum Result {
|
| + ALLOW,
|
| + DENY,
|
| + };
|
| +
|
| + typedef base::Callback<void(Result result)> ResultCallback;
|
| +
|
| + ScreenCaptureConfirmationDialog();
|
| + ~ScreenCaptureConfirmationDialog();
|
| +
|
| + // Shows the screen capture confirmation prompt. |result_callback| will be
|
| + // invoked when the user chooses to stop capturing. |application_name|
|
| + // specifies the name of the application that requested screen capture.
|
| + // Returns false if the prompt cannot be shown for any reason
|
| + // (|result_callback| is ignored in that case).
|
| + bool Show(const ResultCallback& result_callback,
|
| + const string16& application_name);
|
| +
|
| + private:
|
| + void ShowMessageBox();
|
| +
|
| + base::WeakPtrFactory<ScreenCaptureConfirmationDialog> weak_factory_;
|
| +
|
| + string16 application_name_;
|
| + ResultCallback result_callback_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ScreenCaptureConfirmationDialog);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_UI_SCREEN_CAPTURE_CONFIRMATION_DIALOG_H_
|
|
|