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.h" | 5 #include "chrome/browser/extensions/api/tabs/tabs.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 error_ = keys::kInvalidWindowTypeError; | 568 error_ = keys::kInvalidWindowTypeError; |
569 return false; | 569 return false; |
570 } | 570 } |
571 } | 571 } |
572 } | 572 } |
573 | 573 |
574 if (window_type == Browser::TYPE_PANEL) { | 574 if (window_type == Browser::TYPE_PANEL) { |
575 std::string title = | 575 std::string title = |
576 web_app::GenerateApplicationNameFromExtensionId(extension_id); | 576 web_app::GenerateApplicationNameFromExtensionId(extension_id); |
577 #if !defined(USE_ASH) | 577 #if !defined(USE_ASH) |
578 if (CommandLine::ForCurrentProcess()->HasSwitch( | 578 if (PanelManager::UseBrowserlessPanels()) { |
579 switches::kBrowserlessPanels)) { | |
580 // Note: Panels ignore all but the first url provided. | 579 // Note: Panels ignore all but the first url provided. |
581 Panel* panel = PanelManager::GetInstance()->CreatePanel( | 580 Panel* panel = PanelManager::GetInstance()->CreatePanel( |
582 title, window_profile, urls[0], panel_bounds.size()); | 581 title, window_profile, urls[0], panel_bounds.size()); |
583 | 582 |
584 // Unlike other window types, Panels do not take focus by default. | 583 // Unlike other window types, Panels do not take focus by default. |
585 if (!saw_focus_key || !focused) | 584 if (!saw_focus_key || !focused) |
586 panel->ShowInactive(); | 585 panel->ShowInactive(); |
587 else | 586 else |
588 panel->Show(); | 587 panel->Show(); |
589 | 588 |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1820 // called for every API call the extension made. | 1819 // called for every API call the extension made. |
1821 GotLanguage(language); | 1820 GotLanguage(language); |
1822 } | 1821 } |
1823 | 1822 |
1824 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1823 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
1825 SetResult(Value::CreateStringValue(language.c_str())); | 1824 SetResult(Value::CreateStringValue(language.c_str())); |
1826 SendResponse(true); | 1825 SendResponse(true); |
1827 | 1826 |
1828 Release(); // Balanced in Run() | 1827 Release(); // Balanced in Run() |
1829 } | 1828 } |
OLD | NEW |