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/extension_tabs_module.h" | 5 #include "chrome/browser/extensions/extension_tabs_module.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/extensions/extension_window_list.h" | 28 #include "chrome/browser/extensions/extension_window_list.h" |
29 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 29 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
30 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
31 #include "chrome/browser/sessions/restore_tab_helper.h" | 31 #include "chrome/browser/sessions/restore_tab_helper.h" |
32 #include "chrome/browser/tabs/tab_strip_model.h" | 32 #include "chrome/browser/tabs/tab_strip_model.h" |
33 #include "chrome/browser/translate/translate_tab_helper.h" | 33 #include "chrome/browser/translate/translate_tab_helper.h" |
34 #include "chrome/browser/ui/browser.h" | 34 #include "chrome/browser/ui/browser.h" |
35 #include "chrome/browser/ui/browser_list.h" | 35 #include "chrome/browser/ui/browser_list.h" |
36 #include "chrome/browser/ui/browser_navigator.h" | 36 #include "chrome/browser/ui/browser_navigator.h" |
37 #include "chrome/browser/ui/browser_window.h" | 37 #include "chrome/browser/ui/browser_window.h" |
| 38 #include "chrome/browser/ui/extensions/shell_window.h" |
38 #include "chrome/browser/ui/panels/panel_manager.h" | 39 #include "chrome/browser/ui/panels/panel_manager.h" |
39 #include "chrome/browser/ui/snapshot_tab_helper.h" | 40 #include "chrome/browser/ui/snapshot_tab_helper.h" |
40 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 41 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
41 #include "chrome/browser/ui/window_sizer.h" | 42 #include "chrome/browser/ui/window_sizer.h" |
42 #include "chrome/browser/web_applications/web_app.h" | 43 #include "chrome/browser/web_applications/web_app.h" |
43 #include "chrome/common/chrome_notification_types.h" | 44 #include "chrome/common/chrome_notification_types.h" |
44 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
45 #include "chrome/common/extensions/api/windows.h" | 46 #include "chrome/common/extensions/api/windows.h" |
46 #include "chrome/common/extensions/extension.h" | 47 #include "chrome/common/extensions/extension.h" |
47 #include "chrome/common/extensions/extension_error_utils.h" | 48 #include "chrome/common/extensions/extension_error_utils.h" |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 #endif | 554 #endif |
554 #if defined(USE_ASH) | 555 #if defined(USE_ASH) |
555 if (CommandLine::ForCurrentProcess()->HasSwitch( | 556 if (CommandLine::ForCurrentProcess()->HasSwitch( |
556 ash::switches::kAuraPanelManager)) | 557 ash::switches::kAuraPanelManager)) |
557 use_panels = true; | 558 use_panels = true; |
558 #endif | 559 #endif |
559 if (use_panels) | 560 if (use_panels) |
560 window_type = Browser::TYPE_PANEL; | 561 window_type = Browser::TYPE_PANEL; |
561 else | 562 else |
562 window_type = Browser::TYPE_POPUP; | 563 window_type = Browser::TYPE_POPUP; |
| 564 } else if (type_str == keys::kWindowTypeValueShell && |
| 565 GetExtension()->is_platform_app()) { |
| 566 GURL window_url = |
| 567 urls.empty() ? GetExtension()->GetFullLaunchURL() : urls[0]; |
| 568 ShellWindow* shell_window = |
| 569 ShellWindow::Create(window_profile, GetExtension(), window_url); |
| 570 result_.reset(shell_window->extension_window_controller()-> |
| 571 CreateWindowValueWithTabs()); |
| 572 return true; |
563 } else if (type_str != keys::kWindowTypeValueNormal) { | 573 } else if (type_str != keys::kWindowTypeValueNormal) { |
564 error_ = keys::kInvalidWindowTypeError; | 574 error_ = keys::kInvalidWindowTypeError; |
565 return false; | 575 return false; |
566 } | 576 } |
567 } | 577 } |
568 } | 578 } |
569 | 579 |
570 #if defined(USE_ASH) | 580 #if defined(USE_ASH) |
571 // Aura Panels create a new PanelViewAura. | 581 // Aura Panels create a new PanelViewAura. |
572 if (CommandLine::ForCurrentProcess()->HasSwitch( | 582 if (CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 // called for every API call the extension made. | 1817 // called for every API call the extension made. |
1808 GotLanguage(language); | 1818 GotLanguage(language); |
1809 } | 1819 } |
1810 | 1820 |
1811 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1821 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
1812 result_.reset(Value::CreateStringValue(language.c_str())); | 1822 result_.reset(Value::CreateStringValue(language.c_str())); |
1813 SendResponse(true); | 1823 SendResponse(true); |
1814 | 1824 |
1815 Release(); // Balanced in Run() | 1825 Release(); // Balanced in Run() |
1816 } | 1826 } |
OLD | NEW |