| 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 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1775 } | 1775 } |
| 1776 | 1776 |
| 1777 registrar_.RemoveAll(); | 1777 registrar_.RemoveAll(); |
| 1778 | 1778 |
| 1779 // Call GotLanguage in all cases as we want to guarantee the callback is | 1779 // Call GotLanguage in all cases as we want to guarantee the callback is |
| 1780 // called for every API call the extension made. | 1780 // called for every API call the extension made. |
| 1781 GotLanguage(language); | 1781 GotLanguage(language); |
| 1782 } | 1782 } |
| 1783 | 1783 |
| 1784 void TabsDetectLanguageFunction::GotLanguage(const std::string& language) { | 1784 void TabsDetectLanguageFunction::GotLanguage(const std::string& language) { |
| 1785 SetResult(base::MakeUnique<base::StringValue>(language.c_str())); | 1785 SetResult(base::MakeUnique<base::StringValue>(language)); |
| 1786 SendResponse(true); | 1786 SendResponse(true); |
| 1787 | 1787 |
| 1788 Release(); // Balanced in Run() | 1788 Release(); // Balanced in Run() |
| 1789 } | 1789 } |
| 1790 | 1790 |
| 1791 ExecuteCodeInTabFunction::ExecuteCodeInTabFunction() | 1791 ExecuteCodeInTabFunction::ExecuteCodeInTabFunction() |
| 1792 : chrome_details_(this), execute_tab_id_(-1) { | 1792 : chrome_details_(this), execute_tab_id_(-1) { |
| 1793 } | 1793 } |
| 1794 | 1794 |
| 1795 ExecuteCodeInTabFunction::~ExecuteCodeInTabFunction() {} | 1795 ExecuteCodeInTabFunction::~ExecuteCodeInTabFunction() {} |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2110 params->tab_id | 2110 params->tab_id |
| 2111 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, | 2111 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, |
| 2112 base::IntToString(*params->tab_id)) | 2112 base::IntToString(*params->tab_id)) |
| 2113 : keys::kCannotFindTabToDiscard)); | 2113 : keys::kCannotFindTabToDiscard)); |
| 2114 } | 2114 } |
| 2115 | 2115 |
| 2116 TabsDiscardFunction::TabsDiscardFunction() {} | 2116 TabsDiscardFunction::TabsDiscardFunction() {} |
| 2117 TabsDiscardFunction::~TabsDiscardFunction() {} | 2117 TabsDiscardFunction::~TabsDiscardFunction() {} |
| 2118 | 2118 |
| 2119 } // namespace extensions | 2119 } // namespace extensions |
| OLD | NEW |