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, 21a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) const ProtocolHandler& handler, 22a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) GURL url, 23a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) bool user_gesture); 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual ~RegisterProtocolHandlerPermissionRequest(); 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // PermissionBubbleRequest: 27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual int GetIconID() const OVERRIDE; 285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual base::string16 GetMessageText() const OVERRIDE; 295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual base::string16 GetMessageTextFragment() const OVERRIDE; 30a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual bool HasUserGesture() const OVERRIDE; 31a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual GURL GetRequestingHostname() const OVERRIDE; 325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual void PermissionGranted() OVERRIDE; 335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual void PermissionDenied() OVERRIDE; 345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual void Cancelled() OVERRIDE; 355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual void RequestFinished() OVERRIDE; 365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) private: 385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ProtocolHandlerRegistry* registry_; 395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ProtocolHandler handler_; 40a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) GURL url_; 41a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) bool user_gesture_; 425d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 435d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(RegisterProtocolHandlerPermissionRequest); 445d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}; 455d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 465d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif // CHROME_BROWSER_CUSTOM_HANDLERS_REGISTER_PROTOCOL_HANDLER_PERMISSION_REQUEST_H_ 47