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 "extensions/browser/guest_view/extension_options/extension_options_gues
t.h" | 5 #include "extensions/browser/guest_view/extension_options/extension_options_gues
t.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "components/crx_file/id_util.h" | 8 #include "components/crx_file/id_util.h" |
9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
10 #include "content/public/browser/site_instance.h" | 10 #include "content/public/browser/site_instance.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ->CreateExtensionOptionsGuestDelegate(this)) { | 43 ->CreateExtensionOptionsGuestDelegate(this)) { |
44 } | 44 } |
45 | 45 |
46 ExtensionOptionsGuest::~ExtensionOptionsGuest() { | 46 ExtensionOptionsGuest::~ExtensionOptionsGuest() { |
47 } | 47 } |
48 | 48 |
49 // static | 49 // static |
50 extensions::GuestViewBase* ExtensionOptionsGuest::Create( | 50 extensions::GuestViewBase* ExtensionOptionsGuest::Create( |
51 content::BrowserContext* browser_context, | 51 content::BrowserContext* browser_context, |
52 int guest_instance_id) { | 52 int guest_instance_id) { |
| 53 if (!extensions::FeatureSwitch::embedded_extension_options()->IsEnabled()) { |
| 54 return NULL; |
| 55 } |
53 return new ExtensionOptionsGuest(browser_context, guest_instance_id); | 56 return new ExtensionOptionsGuest(browser_context, guest_instance_id); |
54 } | 57 } |
55 | 58 |
56 void ExtensionOptionsGuest::CreateWebContents( | 59 void ExtensionOptionsGuest::CreateWebContents( |
57 const std::string& embedder_extension_id, | 60 const std::string& embedder_extension_id, |
58 int embedder_render_process_id, | 61 int embedder_render_process_id, |
59 const base::DictionaryValue& create_params, | 62 const base::DictionaryValue& create_params, |
60 const WebContentsCreatedCallback& callback) { | 63 const WebContentsCreatedCallback& callback) { |
61 // Get the extension's base URL. | 64 // Get the extension's base URL. |
62 std::string extension_id; | 65 std::string extension_id; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); | 251 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); |
249 | 252 |
250 // Call SetAutoSize to apply all the appropriate validation and clipping of | 253 // Call SetAutoSize to apply all the appropriate validation and clipping of |
251 // values. | 254 // values. |
252 SetAutoSize(auto_size_enabled, | 255 SetAutoSize(auto_size_enabled, |
253 gfx::Size(min_width, min_height), | 256 gfx::Size(min_width, min_height), |
254 gfx::Size(max_width, max_height)); | 257 gfx::Size(max_width, max_height)); |
255 } | 258 } |
256 | 259 |
257 } // namespace extensions | 260 } // namespace extensions |
OLD | NEW |