| 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" |
| 11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 #include "extensions/browser/api/extensions_api_client.h" | 12 #include "extensions/browser/api/extensions_api_client.h" |
| 13 #include "extensions/browser/extension_function_dispatcher.h" | 13 #include "extensions/browser/extension_function_dispatcher.h" |
| 14 #include "extensions/browser/extension_registry.h" | 14 #include "extensions/browser/extension_registry.h" |
| 15 #include "extensions/browser/extension_web_contents_observer.h" | 15 #include "extensions/browser/extension_web_contents_observer.h" |
| 16 #include "extensions/browser/guest_view/extension_options/extension_options_cons
tants.h" | 16 #include "extensions/browser/guest_view/extension_options/extension_options_cons
tants.h" |
| 17 #include "extensions/browser/guest_view/extension_options/extension_options_gues
t_delegate.h" | 17 #include "extensions/browser/guest_view/extension_options/extension_options_gues
t_delegate.h" |
| 18 #include "extensions/browser/guest_view/guest_view_manager.h" | 18 #include "extensions/browser/guest_view/guest_view_manager.h" |
| 19 #include "extensions/common/api/extension_options_internal.h" | 19 #include "extensions/common/api/extension_options_internal.h" |
| 20 #include "extensions/common/constants.h" | 20 #include "extensions/common/constants.h" |
| 21 #include "extensions/common/extension.h" | 21 #include "extensions/common/extension.h" |
| 22 #include "extensions/common/extension_messages.h" | 22 #include "extensions/common/extension_messages.h" |
| 23 #include "extensions/common/feature_switch.h" | |
| 24 #include "extensions/common/manifest_handlers/options_page_info.h" | 23 #include "extensions/common/manifest_handlers/options_page_info.h" |
| 25 #include "extensions/common/permissions/permissions_data.h" | 24 #include "extensions/common/permissions/permissions_data.h" |
| 26 #include "extensions/strings/grit/extensions_strings.h" | 25 #include "extensions/strings/grit/extensions_strings.h" |
| 27 #include "ipc/ipc_message_macros.h" | 26 #include "ipc/ipc_message_macros.h" |
| 28 | 27 |
| 29 using content::WebContents; | 28 using content::WebContents; |
| 30 using namespace extensions::core_api; | 29 using namespace extensions::core_api; |
| 31 | 30 |
| 32 namespace extensions { | 31 namespace extensions { |
| 33 | 32 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 44 has_navigated_(false) { | 43 has_navigated_(false) { |
| 45 } | 44 } |
| 46 | 45 |
| 47 ExtensionOptionsGuest::~ExtensionOptionsGuest() { | 46 ExtensionOptionsGuest::~ExtensionOptionsGuest() { |
| 48 } | 47 } |
| 49 | 48 |
| 50 // static | 49 // static |
| 51 extensions::GuestViewBase* ExtensionOptionsGuest::Create( | 50 extensions::GuestViewBase* ExtensionOptionsGuest::Create( |
| 52 content::BrowserContext* browser_context, | 51 content::BrowserContext* browser_context, |
| 53 int guest_instance_id) { | 52 int guest_instance_id) { |
| 54 if (!extensions::FeatureSwitch::embedded_extension_options()->IsEnabled()) { | |
| 55 return NULL; | |
| 56 } | |
| 57 return new ExtensionOptionsGuest(browser_context, guest_instance_id); | 53 return new ExtensionOptionsGuest(browser_context, guest_instance_id); |
| 58 } | 54 } |
| 59 | 55 |
| 60 void ExtensionOptionsGuest::CreateWebContents( | 56 void ExtensionOptionsGuest::CreateWebContents( |
| 61 const std::string& embedder_extension_id, | 57 const std::string& embedder_extension_id, |
| 62 int embedder_render_process_id, | 58 int embedder_render_process_id, |
| 63 const GURL& embedder_site_url, | 59 const GURL& embedder_site_url, |
| 64 const base::DictionaryValue& create_params, | 60 const base::DictionaryValue& create_params, |
| 65 const WebContentsCreatedCallback& callback) { | 61 const WebContentsCreatedCallback& callback) { |
| 66 // Get the extension's base URL. | 62 // Get the extension's base URL. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); | 255 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); |
| 260 | 256 |
| 261 // Call SetAutoSize to apply all the appropriate validation and clipping of | 257 // Call SetAutoSize to apply all the appropriate validation and clipping of |
| 262 // values. | 258 // values. |
| 263 SetAutoSize(auto_size_enabled, | 259 SetAutoSize(auto_size_enabled, |
| 264 gfx::Size(min_width, min_height), | 260 gfx::Size(min_width, min_height), |
| 265 gfx::Size(max_width, max_height)); | 261 gfx::Size(max_width, max_height)); |
| 266 } | 262 } |
| 267 | 263 |
| 268 } // namespace extensions | 264 } // namespace extensions |
| OLD | NEW |