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 <memory> | 10 #include <memory> |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 else | 651 else |
652 new_window->window()->ShowInactive(); | 652 new_window->window()->ShowInactive(); |
653 | 653 |
654 WindowController* controller = new_window->extension_window_controller(); | 654 WindowController* controller = new_window->extension_window_controller(); |
655 | 655 |
656 std::unique_ptr<base::Value> result; | 656 std::unique_ptr<base::Value> result; |
657 if (new_window->profile()->IsOffTheRecord() && | 657 if (new_window->profile()->IsOffTheRecord() && |
658 !browser_context()->IsOffTheRecord() && !include_incognito()) { | 658 !browser_context()->IsOffTheRecord() && !include_incognito()) { |
659 // Don't expose incognito windows if extension itself works in non-incognito | 659 // Don't expose incognito windows if extension itself works in non-incognito |
660 // profile and CanCrossIncognito isn't allowed. | 660 // profile and CanCrossIncognito isn't allowed. |
661 result = base::Value::CreateNullValue(); | 661 result = base::MakeUnique<base::Value>(); |
662 } else { | 662 } else { |
663 result = controller->CreateWindowValueWithTabs(extension()); | 663 result = controller->CreateWindowValueWithTabs(extension()); |
664 } | 664 } |
665 | 665 |
666 return RespondNow(OneArgument(std::move(result))); | 666 return RespondNow(OneArgument(std::move(result))); |
667 } | 667 } |
668 | 668 |
669 ExtensionFunction::ResponseAction WindowsUpdateFunction::Run() { | 669 ExtensionFunction::ResponseAction WindowsUpdateFunction::Run() { |
670 std::unique_ptr<windows::Update::Params> params( | 670 std::unique_ptr<windows::Update::Params> params( |
671 windows::Update::Params::Create(*args_)); | 671 windows::Update::Params::Create(*args_)); |
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 params->tab_id | 2136 params->tab_id |
2137 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, | 2137 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, |
2138 base::IntToString(*params->tab_id)) | 2138 base::IntToString(*params->tab_id)) |
2139 : keys::kCannotFindTabToDiscard)); | 2139 : keys::kCannotFindTabToDiscard)); |
2140 } | 2140 } |
2141 | 2141 |
2142 TabsDiscardFunction::TabsDiscardFunction() {} | 2142 TabsDiscardFunction::TabsDiscardFunction() {} |
2143 TabsDiscardFunction::~TabsDiscardFunction() {} | 2143 TabsDiscardFunction::~TabsDiscardFunction() {} |
2144 | 2144 |
2145 } // namespace extensions | 2145 } // namespace extensions |
OLD | NEW |