Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 29 #include "chrome/browser/net/url_fixer_upper.h" | 29 #include "chrome/browser/net/url_fixer_upper.h" |
| 30 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 30 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 31 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
| 32 #include "chrome/browser/sessions/restore_tab_helper.h" | 32 #include "chrome/browser/sessions/restore_tab_helper.h" |
| 33 #include "chrome/browser/tabs/tab_strip_model.h" | 33 #include "chrome/browser/tabs/tab_strip_model.h" |
| 34 #include "chrome/browser/translate/translate_tab_helper.h" | 34 #include "chrome/browser/translate/translate_tab_helper.h" |
| 35 #include "chrome/browser/ui/browser.h" | 35 #include "chrome/browser/ui/browser.h" |
| 36 #include "chrome/browser/ui/browser_list.h" | 36 #include "chrome/browser/ui/browser_list.h" |
| 37 #include "chrome/browser/ui/browser_navigator.h" | 37 #include "chrome/browser/ui/browser_navigator.h" |
| 38 #include "chrome/browser/ui/browser_window.h" | 38 #include "chrome/browser/ui/browser_window.h" |
| 39 #include "chrome/browser/ui/extensions/shell_window.h" | |
| 39 #include "chrome/browser/ui/panels/panel_manager.h" | 40 #include "chrome/browser/ui/panels/panel_manager.h" |
| 40 #include "chrome/browser/ui/snapshot_tab_helper.h" | 41 #include "chrome/browser/ui/snapshot_tab_helper.h" |
| 41 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 42 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 42 #include "chrome/browser/ui/window_sizer.h" | 43 #include "chrome/browser/ui/window_sizer.h" |
| 43 #include "chrome/browser/web_applications/web_app.h" | 44 #include "chrome/browser/web_applications/web_app.h" |
| 44 #include "chrome/common/chrome_notification_types.h" | 45 #include "chrome/common/chrome_notification_types.h" |
| 45 #include "chrome/common/chrome_switches.h" | 46 #include "chrome/common/chrome_switches.h" |
| 46 #include "chrome/common/extensions/api/windows.h" | 47 #include "chrome/common/extensions/api/windows.h" |
| 47 #include "chrome/common/extensions/extension.h" | 48 #include "chrome/common/extensions/extension.h" |
| 48 #include "chrome/common/extensions/extension_error_utils.h" | 49 #include "chrome/common/extensions/extension_error_utils.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 578 #endif | 579 #endif |
| 579 #if defined(USE_ASH) | 580 #if defined(USE_ASH) |
| 580 if (CommandLine::ForCurrentProcess()->HasSwitch( | 581 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 581 ash::switches::kAuraPanelManager)) | 582 ash::switches::kAuraPanelManager)) |
| 582 use_panels = true; | 583 use_panels = true; |
| 583 #endif | 584 #endif |
| 584 if (use_panels) | 585 if (use_panels) |
| 585 window_type = Browser::TYPE_PANEL; | 586 window_type = Browser::TYPE_PANEL; |
| 586 else | 587 else |
| 587 window_type = Browser::TYPE_POPUP; | 588 window_type = Browser::TYPE_POPUP; |
| 589 } else if (type_str == keys::kWindowTypeValueShell && | |
| 590 GetExtension()->is_platform_app()) { | |
| 591 GURL window_url = | |
| 592 urls.empty() ? GetExtension()->GetFullLaunchURL() : urls[0]; | |
| 593 ShellWindow* shell_window = | |
| 594 ShellWindow::Create(window_profile, GetExtension(), window_url); | |
|
jstritar
2012/03/19 19:08:52
|window_profile| can be an incognito profile, if s
| |
| 595 result_.reset(shell_window->extension_window_controller()-> | |
| 596 CreateWindowValueWithTabs()); | |
| 597 return true; | |
| 588 } else if (type_str != keys::kWindowTypeValueNormal) { | 598 } else if (type_str != keys::kWindowTypeValueNormal) { |
| 589 error_ = keys::kInvalidWindowTypeError; | 599 error_ = keys::kInvalidWindowTypeError; |
| 590 return false; | 600 return false; |
| 591 } | 601 } |
| 592 } | 602 } |
| 593 } | 603 } |
| 594 | 604 |
| 595 #if defined(USE_ASH) | 605 #if defined(USE_ASH) |
| 596 // Aura Panels create a new PanelViewAura. | 606 // Aura Panels create a new PanelViewAura. |
| 597 if (CommandLine::ForCurrentProcess()->HasSwitch( | 607 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| (...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1812 // called for every API call the extension made. | 1822 // called for every API call the extension made. |
| 1813 GotLanguage(language); | 1823 GotLanguage(language); |
| 1814 } | 1824 } |
| 1815 | 1825 |
| 1816 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1826 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
| 1817 result_.reset(Value::CreateStringValue(language.c_str())); | 1827 result_.reset(Value::CreateStringValue(language.c_str())); |
| 1818 SendResponse(true); | 1828 SendResponse(true); |
| 1819 | 1829 |
| 1820 Release(); // Balanced in Run() | 1830 Release(); // Balanced in Run() |
| 1821 } | 1831 } |
| OLD | NEW |