OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 extension_function_dispatcher_->HandleRequest(params); | 526 extension_function_dispatcher_->HandleRequest(params); |
527 } | 527 } |
528 } | 528 } |
529 | 529 |
530 RenderViewHostDelegate::View* ExtensionHost::GetViewDelegate() { | 530 RenderViewHostDelegate::View* ExtensionHost::GetViewDelegate() { |
531 return this; | 531 return this; |
532 } | 532 } |
533 | 533 |
534 void ExtensionHost::CreateNewWindow( | 534 void ExtensionHost::CreateNewWindow( |
535 int route_id, | 535 int route_id, |
536 WindowContainerType window_container_type, | 536 const ViewHostMsg_CreateWindow_Params& params) { |
537 const string16& frame_name) { | |
538 // TODO(aa): Use the browser's profile if the extension is split mode | 537 // TODO(aa): Use the browser's profile if the extension is split mode |
539 // incognito. | 538 // incognito. |
540 TabContents* new_contents = delegate_view_helper_.CreateNewWindow( | 539 TabContents* new_contents = delegate_view_helper_.CreateNewWindow( |
541 route_id, | 540 route_id, |
542 render_view_host()->process()->profile(), | 541 render_view_host()->process()->profile(), |
543 site_instance(), | 542 site_instance(), |
544 DOMUIFactory::GetDOMUIType(render_view_host()->process()->profile(), | 543 DOMUIFactory::GetDOMUIType(render_view_host()->process()->profile(), |
545 url_), | 544 url_), |
546 this, | 545 this, |
547 window_container_type, | 546 params.window_container_type, |
548 frame_name); | 547 params.frame_name); |
549 | 548 |
550 TabContents* associated_contents = associated_tab_contents(); | 549 TabContents* associated_contents = associated_tab_contents(); |
551 if (associated_contents && associated_contents->delegate()) | 550 if (associated_contents && associated_contents->delegate()) |
552 associated_contents->delegate()->TabContentsCreated(new_contents); | 551 associated_contents->delegate()->TabContentsCreated(new_contents); |
553 } | 552 } |
554 | 553 |
555 void ExtensionHost::CreateNewWidget(int route_id, | 554 void ExtensionHost::CreateNewWidget(int route_id, |
556 WebKit::WebPopupType popup_type) { | 555 WebKit::WebPopupType popup_type) { |
557 CreateNewWidgetInternal(route_id, popup_type); | 556 CreateNewWidgetInternal(route_id, popup_type); |
558 } | 557 } |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 // Extensions hosted in ExternalTabContainer objects may not have | 795 // Extensions hosted in ExternalTabContainer objects may not have |
797 // an associated browser. | 796 // an associated browser. |
798 const Browser* browser = GetBrowser(); | 797 const Browser* browser = GetBrowser(); |
799 if (browser) | 798 if (browser) |
800 window_id = ExtensionTabUtil::GetWindowId(browser); | 799 window_id = ExtensionTabUtil::GetWindowId(browser); |
801 } else if (extension_host_type_ != ViewType::EXTENSION_BACKGROUND_PAGE) { | 800 } else if (extension_host_type_ != ViewType::EXTENSION_BACKGROUND_PAGE) { |
802 NOTREACHED(); | 801 NOTREACHED(); |
803 } | 802 } |
804 return window_id; | 803 return window_id; |
805 } | 804 } |
OLD | NEW |