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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 } | 1944 } |
1945 | 1945 |
1946 registrar_.RemoveAll(); | 1946 registrar_.RemoveAll(); |
1947 | 1947 |
1948 // Call GotLanguage in all cases as we want to guarantee the callback is | 1948 // Call GotLanguage in all cases as we want to guarantee the callback is |
1949 // called for every API call the extension made. | 1949 // called for every API call the extension made. |
1950 GotLanguage(language); | 1950 GotLanguage(language); |
1951 } | 1951 } |
1952 | 1952 |
1953 void TabsDetectLanguageFunction::GotLanguage(const std::string& language) { | 1953 void TabsDetectLanguageFunction::GotLanguage(const std::string& language) { |
1954 SetResult(Value::CreateStringValue(language.c_str())); | 1954 SetResult(new base::StringValue(language.c_str())); |
1955 SendResponse(true); | 1955 SendResponse(true); |
1956 | 1956 |
1957 Release(); // Balanced in Run() | 1957 Release(); // Balanced in Run() |
1958 } | 1958 } |
1959 | 1959 |
1960 ExecuteCodeInTabFunction::ExecuteCodeInTabFunction() | 1960 ExecuteCodeInTabFunction::ExecuteCodeInTabFunction() |
1961 : execute_tab_id_(-1) { | 1961 : execute_tab_id_(-1) { |
1962 } | 1962 } |
1963 | 1963 |
1964 ExecuteCodeInTabFunction::~ExecuteCodeInTabFunction() {} | 1964 ExecuteCodeInTabFunction::~ExecuteCodeInTabFunction() {} |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 execute_tab_id_ = tab_id; | 2065 execute_tab_id_ = tab_id; |
2066 details_ = details.Pass(); | 2066 details_ = details.Pass(); |
2067 return true; | 2067 return true; |
2068 } | 2068 } |
2069 | 2069 |
2070 bool TabsInsertCSSFunction::ShouldInsertCSS() const { | 2070 bool TabsInsertCSSFunction::ShouldInsertCSS() const { |
2071 return true; | 2071 return true; |
2072 } | 2072 } |
2073 | 2073 |
2074 } // namespace extensions | 2074 } // namespace extensions |
OLD | NEW |