Chromium Code Reviews| 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/guest_view/extension_options/extension_options_constant s.h" | 10 #include "chrome/browser/guest_view/extension_options/extension_options_constant s.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/browser.h" | |
| 13 #include "chrome/browser/ui/browser_finder.h" | |
| 14 #include "chrome/browser/ui/browser_window.h" | |
| 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | |
| 11 #include "chrome/common/extensions/api/extension_options_internal.h" | 16 #include "chrome/common/extensions/api/extension_options_internal.h" |
| 12 #include "chrome/common/extensions/manifest_url_handler.h" | 17 #include "chrome/common/extensions/manifest_url_handler.h" |
| 13 #include "content/public/browser/render_process_host.h" | 18 #include "content/public/browser/render_process_host.h" |
| 14 #include "content/public/browser/site_instance.h" | 19 #include "content/public/browser/site_instance.h" |
| 15 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 16 #include "extensions/browser/extension_function_dispatcher.h" | 21 #include "extensions/browser/extension_function_dispatcher.h" |
| 17 #include "extensions/browser/extension_registry.h" | 22 #include "extensions/browser/extension_registry.h" |
| 23 #include "extensions/browser/guest_view/guest_view_manager.h" | |
| 18 #include "extensions/common/extension.h" | 24 #include "extensions/common/extension.h" |
| 19 #include "extensions/common/extension_messages.h" | 25 #include "extensions/common/extension_messages.h" |
| 20 #include "extensions/common/feature_switch.h" | 26 #include "extensions/common/feature_switch.h" |
| 21 #include "extensions/common/permissions/permissions_data.h" | 27 #include "extensions/common/permissions/permissions_data.h" |
| 22 #include "ipc/ipc_message_macros.h" | 28 #include "ipc/ipc_message_macros.h" |
| 23 | 29 |
| 24 using content::WebContents; | 30 using content::WebContents; |
| 25 using namespace extensions::api; | 31 using namespace extensions::api; |
| 26 | 32 |
| 27 // static | 33 // static |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 int min_width = 0; | 176 int min_width = 0; |
| 171 extra_params()->GetInteger(extensionoptions::kAttributeMinHeight, | 177 extra_params()->GetInteger(extensionoptions::kAttributeMinHeight, |
| 172 &min_height); | 178 &min_height); |
| 173 extra_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); | 179 extra_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); |
| 174 | 180 |
| 175 // Call SetAutoSize to apply all the appropriate validation and clipping of | 181 // Call SetAutoSize to apply all the appropriate validation and clipping of |
| 176 // values. | 182 // values. |
| 177 SetAutoSize( | 183 SetAutoSize( |
| 178 true, gfx::Size(min_width, min_height), gfx::Size(max_width, max_height)); | 184 true, gfx::Size(min_width, min_height), gfx::Size(max_width, max_height)); |
| 179 } | 185 } |
| 186 | |
| 187 bool ExtensionOptionsGuest::ShouldCreateWebContents( | |
| 188 content::WebContents* web_contents, | |
| 189 int route_id, | |
| 190 WindowContainerType window_container_type, | |
| 191 const base::string16& frame_name, | |
| 192 const GURL& target_url, | |
| 193 const std::string& partition_id, | |
| 194 content::SessionStorageNamespace* session_storage_namespace) { | |
| 195 Browser* browser = | |
|
Fady Samuel
2014/08/15 20:22:06
A comment on what this does would be very helpful
ericzeng
2014/08/20 20:00:31
Done.
| |
| 196 chrome::FindBrowserWithWebContents(embedder_web_contents()); | |
| 197 content::OpenURLParams params(target_url, | |
| 198 content::Referrer(), | |
| 199 NEW_FOREGROUND_TAB, | |
| 200 content::PAGE_TRANSITION_LINK, | |
| 201 false); | |
| 202 browser->OpenURL(params); | |
| 203 browser->window()->Show(); | |
|
not at google - send to devlin
2014/08/15 20:31:38
You should also add a TODO to respect the user's c
Fady Samuel
2014/08/15 20:35:51
Hmm, this can be determined by the disposition of
| |
| 204 return false; | |
| 205 } | |
| OLD | NEW |