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 <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 #endif | 530 #endif |
531 #if defined(USE_ASH) | 531 #if defined(USE_ASH) |
532 if (CommandLine::ForCurrentProcess()->HasSwitch( | 532 if (CommandLine::ForCurrentProcess()->HasSwitch( |
533 ash::switches::kAuraPanelManager)) | 533 ash::switches::kAuraPanelManager)) |
534 use_panels = true; | 534 use_panels = true; |
535 #endif | 535 #endif |
536 if (use_panels) | 536 if (use_panels) |
537 window_type = Browser::TYPE_PANEL; | 537 window_type = Browser::TYPE_PANEL; |
538 else | 538 else |
539 window_type = Browser::TYPE_POPUP; | 539 window_type = Browser::TYPE_POPUP; |
540 } else if (type_str == keys::kWindowTypeValueShell && | |
541 GetExtension()->is_platform_app()) { | |
542 // TODO(jeremya): remove this method of creating shell windows. | |
543 GURL window_url = urls.empty() ? GURL(chrome::kAboutBlankURL) : urls[0]; | |
544 ShellWindow::CreateParams params; | |
545 params.bounds = window_bounds; | |
546 ShellWindow* shell_window = ShellWindow::Create( | |
547 window_profile, GetExtension(), window_url, params); | |
548 shell_window->Show(); | |
549 result_.reset(shell_window->extension_window_controller()-> | |
550 CreateWindowValueWithTabs()); | |
551 return true; | |
552 } else if (type_str != keys::kWindowTypeValueNormal) { | 540 } else if (type_str != keys::kWindowTypeValueNormal) { |
553 error_ = keys::kInvalidWindowTypeError; | 541 error_ = keys::kInvalidWindowTypeError; |
554 return false; | 542 return false; |
555 } | 543 } |
556 } | 544 } |
557 } | 545 } |
558 | 546 |
559 #if defined(USE_ASH) | 547 #if defined(USE_ASH) |
560 // Aura Panels create a new PanelViewAura. | 548 // Aura Panels create a new PanelViewAura. |
561 if (CommandLine::ForCurrentProcess()->HasSwitch( | 549 if (CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 // called for every API call the extension made. | 1772 // called for every API call the extension made. |
1785 GotLanguage(language); | 1773 GotLanguage(language); |
1786 } | 1774 } |
1787 | 1775 |
1788 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1776 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
1789 result_.reset(Value::CreateStringValue(language.c_str())); | 1777 result_.reset(Value::CreateStringValue(language.c_str())); |
1790 SendResponse(true); | 1778 SendResponse(true); |
1791 | 1779 |
1792 Release(); // Balanced in Run() | 1780 Release(); // Balanced in Run() |
1793 } | 1781 } |
OLD | NEW |