yusukes | 1168eda | 2016-04-27 07:52:08 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef ASH_LINK_HANDLER_MODEL_H_ |
| 6 | #define ASH_LINK_HANDLER_MODEL_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include "ash/ash_export.h" |
| 12 | #include "ui/gfx/image/image.h" |
| 13 | |
| 14 | class GURL; |
| 15 | |
| 16 | namespace ash { |
| 17 | |
| 18 | struct ASH_EXPORT LinkHandlerInfo { |
| 19 | std::string name; |
| 20 | gfx::Image icon; |
| 21 | uint32_t id; |
| 22 | }; |
| 23 | |
| 24 | // A model LinkHandlerModelFactory returns. |
| 25 | class ASH_EXPORT LinkHandlerModel { |
| 26 | public: |
| 27 | class Observer { |
| 28 | public: |
| 29 | virtual ~Observer(); |
| 30 | virtual void ModelChanged(const std::vector<LinkHandlerInfo>& handlers) = 0; |
| 31 | }; |
| 32 | |
| 33 | virtual ~LinkHandlerModel(); |
| 34 | virtual void AddObserver(Observer* observer) = 0; |
| 35 | |
| 36 | // Opens the |url| with a handler specified by the |handler_id|. |
| 37 | virtual void OpenLinkWithHandler(const GURL& url, uint32_t handler_id) = 0; |
| 38 | }; |
| 39 | |
| 40 | } // namespace ash |
| 41 | |
| 42 | #endif // ASH_LINK_HANDLER_MODEL_H_ |