OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/guest_view/extension_options/extension_options_guest.h" | 5 #include "chrome/browser/guest_view/extension_options/extension_options_guest.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 8 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
9 #include "chrome/browser/extensions/extension_tab_util.h" | 9 #include "chrome/browser/extensions/extension_tab_util.h" |
10 #include "chrome/browser/guest_view/extension_options/extension_options_constant s.h" | 10 #include "chrome/browser/guest_view/extension_options/extension_options_constant s.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 ContextMenuDelegate* menu_delegate = | 166 ContextMenuDelegate* menu_delegate = |
167 ContextMenuDelegate::FromWebContents(guest_web_contents()); | 167 ContextMenuDelegate::FromWebContents(guest_web_contents()); |
168 DCHECK(menu_delegate); | 168 DCHECK(menu_delegate); |
169 | 169 |
170 scoped_ptr<RenderViewContextMenu> menu = | 170 scoped_ptr<RenderViewContextMenu> menu = |
171 menu_delegate->BuildMenu(guest_web_contents(), params); | 171 menu_delegate->BuildMenu(guest_web_contents(), params); |
172 menu_delegate->ShowMenu(menu.Pass()); | 172 menu_delegate->ShowMenu(menu.Pass()); |
173 return true; | 173 return true; |
174 } | 174 } |
175 | 175 |
176 void ExtensionOptionsGuest::RunFileChooser( | |
Fady Samuel
2014/09/02 21:34:18
Could we please move this to GuestViewBase instead
ericzeng
2014/09/02 23:07:30
Done.
| |
177 WebContents* web_contents, | |
178 const content::FileChooserParams& params) { | |
179 if (!embedder_web_contents() || !embedder_web_contents()->GetDelegate()) | |
180 return; | |
181 embedder_web_contents()->GetDelegate()->RunFileChooser(web_contents, params); | |
182 } | |
183 | |
176 bool ExtensionOptionsGuest::ShouldCreateWebContents( | 184 bool ExtensionOptionsGuest::ShouldCreateWebContents( |
177 content::WebContents* web_contents, | 185 content::WebContents* web_contents, |
178 int route_id, | 186 int route_id, |
179 WindowContainerType window_container_type, | 187 WindowContainerType window_container_type, |
180 const base::string16& frame_name, | 188 const base::string16& frame_name, |
181 const GURL& target_url, | 189 const GURL& target_url, |
182 const std::string& partition_id, | 190 const std::string& partition_id, |
183 content::SessionStorageNamespace* session_storage_namespace) { | 191 content::SessionStorageNamespace* session_storage_namespace) { |
184 // This method handles opening links from within the guest. Since this guest | 192 // This method handles opening links from within the guest. Since this guest |
185 // view is used for displaying embedded extension options, we want any | 193 // view is used for displaying embedded extension options, we want any |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 attach_params()->GetInteger(extensionoptions::kAttributeMinHeight, | 239 attach_params()->GetInteger(extensionoptions::kAttributeMinHeight, |
232 &min_height); | 240 &min_height); |
233 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); | 241 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); |
234 | 242 |
235 // Call SetAutoSize to apply all the appropriate validation and clipping of | 243 // Call SetAutoSize to apply all the appropriate validation and clipping of |
236 // values. | 244 // values. |
237 SetAutoSize(auto_size_enabled, | 245 SetAutoSize(auto_size_enabled, |
238 gfx::Size(min_width, min_height), | 246 gfx::Size(min_width, min_height), |
239 gfx::Size(max_width, max_height)); | 247 gfx::Size(max_width, max_height)); |
240 } | 248 } |
OLD | NEW |