12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright (c) 2013 The Chromium Authors. All rights reserved.
22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file.
42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#ifndef CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_
62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_
72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/basictypes.h"
97dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "url/gurl.h"
102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Interface implemented by objects that wish to show a dialog box Window for
122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// handling special protocols. The window that is displayed uses this interface
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// to determine the text displayed and notify the delegate object of certain
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// events.
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class ProtocolDialogDelegate {
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  explicit ProtocolDialogDelegate(const GURL& url) : url_(url) {}
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual ~ProtocolDialogDelegate() {}
192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Called if the user has chosen to launch the application for this protocol.
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // |dont_block| is true if the checkbox to prevent future instances of this
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // dialog is checked.
232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void DoAccept(const GURL& url, bool dont_block) const = 0;
242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Called if the user has chosen to do nothing for this protocol.
262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // |dont_block| is true if the checkbox to prevent future instances of this
272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // dialog is checked.
282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void DoCancel(const GURL& url, bool dont_block) const = 0;
292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
30a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetMessageText() const = 0;
31a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetCheckboxText() const = 0;
32a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetTitleText() const = 0;
332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  const GURL& url() const { return url_; }
352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private:
372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  const GURL url_;
382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif  // CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_
41