OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ | 5 #ifndef UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ |
6 #define UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ | 6 #define UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "content/public/browser/web_contents_delegate.h" | |
12 #include "ui/base/ui_base_types.h" | 13 #include "ui/base/ui_base_types.h" |
13 #include "ui/base/window_open_disposition.h" | 14 #include "ui/base/window_open_disposition.h" |
14 #include "ui/web_dialogs/web_dialogs_export.h" | 15 #include "ui/web_dialogs/web_dialogs_export.h" |
15 | 16 |
16 class GURL; | 17 class GURL; |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 class RenderViewHost; | 20 class RenderViewHost; |
20 class WebContents; | 21 class WebContents; |
21 class WebUI; | 22 class WebUI; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 // WebContent where the operation originated. |disposition| controls how the | 122 // WebContent where the operation originated. |disposition| controls how the |
122 // new tab should be opened. |initial_pos| is the position of the window if a | 123 // new tab should be opened. |initial_pos| is the position of the window if a |
123 // new window is created. |user_gesture| is true if the operation was started | 124 // new window is created. |user_gesture| is true if the operation was started |
124 // by a user gesture. Return false to use the default handler. | 125 // by a user gesture. Return false to use the default handler. |
125 virtual bool HandleAddNewContents(content::WebContents* source, | 126 virtual bool HandleAddNewContents(content::WebContents* source, |
126 content::WebContents* new_contents, | 127 content::WebContents* new_contents, |
127 WindowOpenDisposition disposition, | 128 WindowOpenDisposition disposition, |
128 const gfx::Rect& initial_pos, | 129 const gfx::Rect& initial_pos, |
129 bool user_gesture); | 130 bool user_gesture); |
130 | 131 |
132 // A callback to control whether a WebContents will be created. Returns | |
133 // false to disallow the creation. Return true to use the default handler. | |
134 virtual bool HandleShouldCreateWebContents( | |
dzhioev (left Google)
2014/12/22 18:30:13
I don't think we need to pass all the arguments of
Ivan Podogov
2014/12/23 06:54:51
True, but I'm not sure if it is a good idea to lea
dzhioev (left Google)
2014/12/23 14:34:25
Let's drop all of them. It is not hard to add para
Ivan Podogov
2014/12/23 14:41:37
Done.
| |
135 content::WebContents* web_contents, | |
136 int route_id, | |
137 int main_frame_route_id, | |
138 WindowContainerType window_container_type, | |
139 const base::string16& frame_name, | |
140 const GURL& target_url, | |
141 const std::string& partition_id, | |
142 content::SessionStorageNamespace* session_storage_namespace); | |
143 | |
131 // Stores the dialog bounds. | 144 // Stores the dialog bounds. |
132 virtual void StoreDialogSize(const gfx::Size& dialog_size) {} | 145 virtual void StoreDialogSize(const gfx::Size& dialog_size) {} |
133 | 146 |
134 virtual ~WebDialogDelegate() {} | 147 virtual ~WebDialogDelegate() {} |
135 }; | 148 }; |
136 | 149 |
137 } // namespace ui | 150 } // namespace ui |
138 | 151 |
139 #endif // UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ | 152 #endif // UI_WEB_DIALOGS_WEB_DIALOG_DELEGATE_H_ |
OLD | NEW |