diff options
author | calamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 07:54:20 +0000 |
---|---|---|
committer | calamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 07:54:20 +0000 |
commit | 42dc940e7f0444dffc648b97f29dc77fbd72cd4a (patch) | |
tree | 3728dbd3e0b03357d78a3e95c37d673c1406fd11 /chrome/browser/ui/protocol_dialog_delegate.h | |
parent | d7d325edf15f942707f4d9895069ed8426c5b390 (diff) | |
download | chromium_src-42dc940e7f0444dffc648b97f29dc77fbd72cd4a.zip chromium_src-42dc940e7f0444dffc648b97f29dc77fbd72cd4a.tar.gz chromium_src-42dc940e7f0444dffc648b97f29dc77fbd72cd4a.tar.bz2 |
Refactor external protocol handler dialog for linux
This is in preparation for adding chrome-app link handlers which
will also require this popup.
BUG=
Review URL: https://chromiumcodereview.appspot.com/12051033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/protocol_dialog_delegate.h')
-rw-r--r-- | chrome/browser/ui/protocol_dialog_delegate.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/chrome/browser/ui/protocol_dialog_delegate.h b/chrome/browser/ui/protocol_dialog_delegate.h new file mode 100644 index 0000000..81b5367 --- /dev/null +++ b/chrome/browser/ui/protocol_dialog_delegate.h @@ -0,0 +1,40 @@ +// Copyright (c) 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_PROTOCOL_DIALOG_DELEGATE_H_ +#define CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_ + +#include "base/basictypes.h" +#include "googleurl/src/gurl.h" + +// Interface implemented by objects that wish to show a dialog box Window for +// handling special protocols. The window that is displayed uses this interface +// to determine the text displayed and notify the delegate object of certain +// events. +class ProtocolDialogDelegate { + public: + explicit ProtocolDialogDelegate(const GURL& url) : url_(url) {} + virtual ~ProtocolDialogDelegate() {} + + // Called if the user has chosen to launch the application for this protocol. + // |dont_block| is true if the checkbox to prevent future instances of this + // dialog is checked. + virtual void DoAccept(const GURL& url, bool dont_block) const = 0; + + // Called if the user has chosen to do nothing for this protocol. + // |dont_block| is true if the checkbox to prevent future instances of this + // dialog is checked. + virtual void DoCancel(const GURL& url, bool dont_block) const = 0; + + virtual string16 GetMessageText() const = 0; + virtual string16 GetCheckboxText() const = 0; + virtual string16 GetTitleText() const = 0; + + const GURL& url() const { return url_; } + + private: + const GURL url_; +}; + +#endif // CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_ |