| 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 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1782 } | 1782 } |
| 1783 | 1783 |
| 1784 registrar_.RemoveAll(); | 1784 registrar_.RemoveAll(); |
| 1785 | 1785 |
| 1786 // Call GotLanguage in all cases as we want to guarantee the callback is | 1786 // Call GotLanguage in all cases as we want to guarantee the callback is |
| 1787 // called for every API call the extension made. | 1787 // called for every API call the extension made. |
| 1788 GotLanguage(language); | 1788 GotLanguage(language); |
| 1789 } | 1789 } |
| 1790 | 1790 |
| 1791 void TabsDetectLanguageFunction::GotLanguage(const std::string& language) { | 1791 void TabsDetectLanguageFunction::GotLanguage(const std::string& language) { |
| 1792 SetResult(base::MakeUnique<base::Value>(language.c_str())); | 1792 SetResult(base::MakeUnique<base::Value>(language)); |
| 1793 SendResponse(true); | 1793 SendResponse(true); |
| 1794 | 1794 |
| 1795 Release(); // Balanced in Run() | 1795 Release(); // Balanced in Run() |
| 1796 } | 1796 } |
| 1797 | 1797 |
| 1798 ExecuteCodeInTabFunction::ExecuteCodeInTabFunction() | 1798 ExecuteCodeInTabFunction::ExecuteCodeInTabFunction() |
| 1799 : chrome_details_(this), execute_tab_id_(-1) { | 1799 : chrome_details_(this), execute_tab_id_(-1) { |
| 1800 } | 1800 } |
| 1801 | 1801 |
| 1802 ExecuteCodeInTabFunction::~ExecuteCodeInTabFunction() {} | 1802 ExecuteCodeInTabFunction::~ExecuteCodeInTabFunction() {} |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2122 params->tab_id | 2122 params->tab_id |
| 2123 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, | 2123 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, |
| 2124 base::IntToString(*params->tab_id)) | 2124 base::IntToString(*params->tab_id)) |
| 2125 : keys::kCannotFindTabToDiscard)); | 2125 : keys::kCannotFindTabToDiscard)); |
| 2126 } | 2126 } |
| 2127 | 2127 |
| 2128 TabsDiscardFunction::TabsDiscardFunction() {} | 2128 TabsDiscardFunction::TabsDiscardFunction() {} |
| 2129 TabsDiscardFunction::~TabsDiscardFunction() {} | 2129 TabsDiscardFunction::~TabsDiscardFunction() {} |
| 2130 | 2130 |
| 2131 } // namespace extensions | 2131 } // namespace extensions |
| OLD | NEW |