register_protocol_handler_permission_request.h revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file.
45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#ifndef CHROME_BROWSER_CUSTOM_HANDLERS_REGISTER_PROTOCOL_HANDLER_PERMISSION_REQUEST_H_
65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define CHROME_BROWSER_CUSTOM_HANDLERS_REGISTER_PROTOCOL_HANDLER_PERMISSION_REQUEST_H_
75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "chrome/browser/ui/website_settings/permission_bubble_request.h"
95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "chrome/common/custom_handlers/protocol_handler.h"
105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class ProtocolHandlerRegistry;
125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// This class provides display data for a permission bubble request, shown when
145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// a page wants to register a protocol handler and was triggered by a user
155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// action.
165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class RegisterProtocolHandlerPermissionRequest
175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    : public PermissionBubbleRequest {
185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public:
195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  RegisterProtocolHandlerPermissionRequest(
205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)      ProtocolHandlerRegistry* registry,
215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)      const ProtocolHandler& handler);
225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual ~RegisterProtocolHandlerPermissionRequest();
235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // PermissionBubbleRequest:
255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual base::string16 GetMessageText() const OVERRIDE;
265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual base::string16 GetMessageTextFragment() const OVERRIDE;
275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual base::string16 GetAlternateAcceptButtonText() const OVERRIDE;
285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual base::string16 GetAlternateDenyButtonText() const OVERRIDE;
295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void PermissionGranted() OVERRIDE;
305d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void PermissionDenied() OVERRIDE;
315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void Cancelled() OVERRIDE;
325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void RequestFinished() OVERRIDE;
335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) private:
355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  ProtocolHandlerRegistry* registry_;
365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  ProtocolHandler handler_;
375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(RegisterProtocolHandlerPermissionRequest);
395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)};
405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif  // CHROME_BROWSER_CUSTOM_HANDLERS_REGISTER_PROTOCOL_HANDLER_PERMISSION_REQUEST_H_
42