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_EXTERNAL_PROTOCOL_DIALOG_DELEGATE_H_
62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define CHROME_BROWSER_UI_EXTERNAL_PROTOCOL_DIALOG_DELEGATE_H_
72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/basictypes.h"
92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/compiler_specific.h"
10eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/time/time.h"
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/ui/protocol_dialog_delegate.h"
127dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "url/gurl.h"
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Provides text for the external protocol handler dialog and handles whether
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// or not to launch the application for the given protocol.
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class ExternalProtocolDialogDelegate : public ProtocolDialogDelegate {
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  explicit ExternalProtocolDialogDelegate(const GURL& url,
195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                                          int render_process_host_id,
205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                                          int tab_contents_id);
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual ~ExternalProtocolDialogDelegate();
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
23a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  const base::string16& program_name() const { return program_name_; }
245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void DoAccept(const GURL& url, bool dont_block) const OVERRIDE;
262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void DoCancel(const GURL& url, bool dont_block) const OVERRIDE;
272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
28a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetMessageText() const OVERRIDE;
29a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetCheckboxText() const OVERRIDE;
30a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetTitleText() const OVERRIDE;
315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) private:
335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  int render_process_host_id_;
345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  int tab_contents_id_;
35a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  const base::string16 program_name_;
365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialogDelegate);
382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif  // CHROME_BROWSER_UI_EXTERNAL_PROTOCOL_DIALOG_DELEGATE_H_
41