OLD | NEW |
| (Empty) |
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 SERVICES_NAVIGATION_PUBLIC_CPP_VIEW_DELEGATE_H_ | |
6 #define SERVICES_NAVIGATION_PUBLIC_CPP_VIEW_DELEGATE_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 namespace gfx { | |
11 class Rect; | |
12 } | |
13 | |
14 namespace navigation { | |
15 | |
16 class View; | |
17 | |
18 class ViewDelegate { | |
19 public: | |
20 // Called when an action within the page has caused a new View to be created. | |
21 // The delegate must take action to either create a new host for this View, or | |
22 // close it. | |
23 // |source| is the View originating the request. | |
24 // |new_view| is the newly created View. | |
25 // |is_popup| is true if the View should be shown in a popup window instead of | |
26 // a new tab. | |
27 // |requested_bounds| are the requested bounds of the new popup. | |
28 // |user_gesture| is true if the View was created as the result of an explicit | |
29 // user input event. | |
30 virtual void ViewCreated(View* source, | |
31 std::unique_ptr<View> new_view, | |
32 bool is_popup, | |
33 const gfx::Rect& requested_bounds, | |
34 bool user_gesture) = 0; | |
35 | |
36 // Called when an action within the page has requested that the View be | |
37 // closed. | |
38 virtual void Close(View* source) = 0; | |
39 | |
40 // Called when the application in the source view wants the delegate to | |
41 // navigate the view according to |params|. | |
42 virtual void OpenURL(View* source, mojom::OpenURLParamsPtr params) = 0; | |
43 }; | |
44 | |
45 } // namespace navigation | |
46 | |
47 #endif // SERVICES_NAVIGATION_PUBLIC_CPP_VIEW_DELEGATE_H_ | |
OLD | NEW |