| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/api/tabs/tabs_api.h" | 5 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 panel->ShowInactive(); | 619 panel->ShowInactive(); |
| 620 else | 620 else |
| 621 panel->Show(); | 621 panel->Show(); |
| 622 | 622 |
| 623 SetResult(panel->extension_window_controller()->CreateWindowValueWithTabs( | 623 SetResult(panel->extension_window_controller()->CreateWindowValueWithTabs( |
| 624 extension())); | 624 extension())); |
| 625 return true; | 625 return true; |
| 626 } | 626 } |
| 627 | 627 |
| 628 // Create a new BrowserWindow. | 628 // Create a new BrowserWindow. |
| 629 chrome::HostDesktopType host_desktop_type = chrome::GetActiveDesktop(); | |
| 630 if (create_panel) | 629 if (create_panel) |
| 631 window_type = Browser::TYPE_POPUP; | 630 window_type = Browser::TYPE_POPUP; |
| 632 Browser::CreateParams create_params(window_type, window_profile, | 631 Browser::CreateParams create_params(window_type, window_profile); |
| 633 host_desktop_type); | |
| 634 if (extension_id.empty()) { | 632 if (extension_id.empty()) { |
| 635 create_params.initial_bounds = window_bounds; | 633 create_params.initial_bounds = window_bounds; |
| 636 } else { | 634 } else { |
| 637 create_params = Browser::CreateParams::CreateForApp( | 635 create_params = Browser::CreateParams::CreateForApp( |
| 638 web_app::GenerateApplicationNameFromExtensionId(extension_id), | 636 web_app::GenerateApplicationNameFromExtensionId(extension_id), |
| 639 false /* trusted_source */, | 637 false /* trusted_source */, window_bounds, window_profile); |
| 640 window_bounds, | |
| 641 window_profile, | |
| 642 host_desktop_type); | |
| 643 } | 638 } |
| 644 create_params.initial_show_state = ui::SHOW_STATE_NORMAL; | 639 create_params.initial_show_state = ui::SHOW_STATE_NORMAL; |
| 645 if (create_data && create_data->state) { | 640 if (create_data && create_data->state) { |
| 646 create_params.initial_show_state = | 641 create_params.initial_show_state = |
| 647 ConvertToWindowShowState(create_data->state); | 642 ConvertToWindowShowState(create_data->state); |
| 648 } | 643 } |
| 649 create_params.host_desktop_type = chrome::GetActiveDesktop(); | |
| 650 | 644 |
| 651 Browser* new_window = new Browser(create_params); | 645 Browser* new_window = new Browser(create_params); |
| 652 | 646 |
| 653 for (std::vector<GURL>::iterator i = urls.begin(); i != urls.end(); ++i) { | 647 for (std::vector<GURL>::iterator i = urls.begin(); i != urls.end(); ++i) { |
| 654 WebContents* tab = chrome::AddSelectedTabWithURL( | 648 WebContents* tab = chrome::AddSelectedTabWithURL( |
| 655 new_window, *i, ui::PAGE_TRANSITION_LINK); | 649 new_window, *i, ui::PAGE_TRANSITION_LINK); |
| 656 if (create_panel) { | 650 if (create_panel) { |
| 657 TabHelper::FromWebContents(tab)->SetExtensionAppIconById(extension_id); | 651 TabHelper::FromWebContents(tab)->SetExtensionAppIconById(extension_id); |
| 658 } | 652 } |
| 659 } | 653 } |
| (...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2097 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); | 2091 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); |
| 2098 zoom_settings.default_zoom_factor.reset(new double( | 2092 zoom_settings.default_zoom_factor.reset(new double( |
| 2099 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); | 2093 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); |
| 2100 | 2094 |
| 2101 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); | 2095 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); |
| 2102 SendResponse(true); | 2096 SendResponse(true); |
| 2103 return true; | 2097 return true; |
| 2104 } | 2098 } |
| 2105 | 2099 |
| 2106 } // namespace extensions | 2100 } // namespace extensions |
| OLD | NEW |