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 } | |
56 return new ExtensionOptionsGuest(browser_context, guest_instance_id); | 53 return new ExtensionOptionsGuest(browser_context, guest_instance_id); |
57 } | 54 } |
58 | 55 |
59 void ExtensionOptionsGuest::CreateWebContents( | 56 void ExtensionOptionsGuest::CreateWebContents( |
60 const std::string& embedder_extension_id, | 57 const std::string& embedder_extension_id, |
61 int embedder_render_process_id, | 58 int embedder_render_process_id, |
62 const base::DictionaryValue& create_params, | 59 const base::DictionaryValue& create_params, |
63 const WebContentsCreatedCallback& callback) { | 60 const WebContentsCreatedCallback& callback) { |
64 // Get the extension's base URL. | 61 // Get the extension's base URL. |
65 std::string extension_id; | 62 std::string extension_id; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); | 248 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); |
252 | 249 |
253 // Call SetAutoSize to apply all the appropriate validation and clipping of | 250 // Call SetAutoSize to apply all the appropriate validation and clipping of |
254 // values. | 251 // values. |
255 SetAutoSize(auto_size_enabled, | 252 SetAutoSize(auto_size_enabled, |
256 gfx::Size(min_width, min_height), | 253 gfx::Size(min_width, min_height), |
257 gfx::Size(max_width, max_height)); | 254 gfx::Size(max_width, max_height)); |
258 } | 255 } |
259 | 256 |
260 } // namespace extensions | 257 } // namespace extensions |
OLD | NEW |