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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 77 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
78 #include "chrome/browser/ui/bookmarks/bookmarks_tab_helper.h" | 78 #include "chrome/browser/ui/bookmarks/bookmarks_tab_helper.h" |
79 #include "chrome/browser/ui/browser_list.h" | 79 #include "chrome/browser/ui/browser_list.h" |
80 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 80 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
81 #include "chrome/browser/ui/browser_window.h" | 81 #include "chrome/browser/ui/browser_window.h" |
82 #include "chrome/browser/ui/download/download_tab_helper.h" | 82 #include "chrome/browser/ui/download/download_tab_helper.h" |
83 #include "chrome/browser/ui/find_bar/find_bar.h" | 83 #include "chrome/browser/ui/find_bar/find_bar.h" |
84 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 84 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
85 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 85 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
86 #include "chrome/browser/ui/omnibox/location_bar.h" | 86 #include "chrome/browser/ui/omnibox/location_bar.h" |
87 #include "chrome/browser/ui/panels/extension_panel_originator.h" | |
87 #include "chrome/browser/ui/panels/panel.h" | 88 #include "chrome/browser/ui/panels/panel.h" |
88 #include "chrome/browser/ui/panels/panel_manager.h" | 89 #include "chrome/browser/ui/panels/panel_manager.h" |
89 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 90 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
90 #include "chrome/browser/ui/status_bubble.h" | 91 #include "chrome/browser/ui/status_bubble.h" |
91 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 92 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
92 #include "chrome/browser/ui/tabs/dock_info.h" | 93 #include "chrome/browser/ui/tabs/dock_info.h" |
93 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 94 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
94 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 95 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
95 #include "chrome/browser/ui/webui/active_downloads_ui.h" | 96 #include "chrome/browser/ui/webui/active_downloads_ui.h" |
96 #include "chrome/browser/ui/webui/bug_report_ui.h" | 97 #include "chrome/browser/ui/webui/bug_report_ui.h" |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
591 Type type = extension && (container == extension_misc::LAUNCH_PANEL) ? | 592 Type type = extension && (container == extension_misc::LAUNCH_PANEL) ? |
592 TYPE_PANEL : TYPE_POPUP; | 593 TYPE_PANEL : TYPE_POPUP; |
593 | 594 |
594 gfx::Size window_size; | 595 gfx::Size window_size; |
595 if (extension) | 596 if (extension) |
596 window_size.SetSize(extension->launch_width(), | 597 window_size.SetSize(extension->launch_width(), |
597 extension->launch_height()); | 598 extension->launch_height()); |
598 | 599 |
599 Browser* browser = Browser::CreateForApp(type, app_name, window_size, | 600 Browser* browser = Browser::CreateForApp(type, app_name, window_size, |
600 profile); | 601 profile); |
602 Panel* panel = browser->window()->GetAsPanel(); | |
jennb
2011/05/12 18:15:51
There are other places where a Browser of type PAN
jianli
2011/05/24 00:56:24
Removed since it is not needed now.
| |
603 if (panel) | |
604 panel->set_originator(new ExtensionPanelOriginator(extension, profile)); | |
601 | 605 |
602 if (app_browser) | 606 if (app_browser) |
603 *app_browser = browser; | 607 *app_browser = browser; |
604 | 608 |
605 TabContentsWrapper* wrapper = | 609 TabContentsWrapper* wrapper = |
606 browser->AddSelectedTabWithURL(url, PageTransition::START_PAGE); | 610 browser->AddSelectedTabWithURL(url, PageTransition::START_PAGE); |
607 TabContents* contents = wrapper->tab_contents(); | 611 TabContents* contents = wrapper->tab_contents(); |
608 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 612 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
609 contents->render_view_host()->SyncRendererPrefs(); | 613 contents->render_view_host()->SyncRendererPrefs(); |
610 browser->window()->Show(); | 614 browser->window()->Show(); |
(...skipping 3990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4601 TabContents* current_tab = GetSelectedTabContents(); | 4605 TabContents* current_tab = GetSelectedTabContents(); |
4602 if (current_tab) { | 4606 if (current_tab) { |
4603 content_restrictions = current_tab->content_restrictions(); | 4607 content_restrictions = current_tab->content_restrictions(); |
4604 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 4608 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); |
4605 // See comment in UpdateCommandsForTabState about why we call url(). | 4609 // See comment in UpdateCommandsForTabState about why we call url(). |
4606 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) | 4610 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) |
4607 content_restrictions |= CONTENT_RESTRICTION_SAVE; | 4611 content_restrictions |= CONTENT_RESTRICTION_SAVE; |
4608 } | 4612 } |
4609 return content_restrictions; | 4613 return content_restrictions; |
4610 } | 4614 } |
OLD | NEW |