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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 DCHECK_EQ(url.spec(), web_contents_->GetURL().spec()); | 1332 DCHECK_EQ(url.spec(), web_contents_->GetURL().spec()); |
1333 | 1333 |
1334 return true; | 1334 return true; |
1335 } | 1335 } |
1336 | 1336 |
1337 void TabsUpdateFunction::PopulateResult() { | 1337 void TabsUpdateFunction::PopulateResult() { |
1338 if (!has_callback()) | 1338 if (!has_callback()) |
1339 return; | 1339 return; |
1340 | 1340 |
1341 results_ = tabs::Get::Results::Create( | 1341 results_ = tabs::Get::Results::Create( |
1342 *ExtensionTabUtil::CreateTabObject(web_contents_, extension())); | 1342 *ExtensionTabUtil::CreateTabObjectVisibleUrl(web_contents_, extension())); |
1343 } | 1343 } |
1344 | 1344 |
1345 void TabsUpdateFunction::OnExecuteCodeFinished( | 1345 void TabsUpdateFunction::OnExecuteCodeFinished( |
1346 const std::string& error, | 1346 const std::string& error, |
1347 const GURL& url, | 1347 const GURL& url, |
1348 const base::ListValue& script_result) { | 1348 const base::ListValue& script_result) { |
1349 if (error.empty()) | 1349 if (error.empty()) |
1350 PopulateResult(); | 1350 PopulateResult(); |
1351 else | 1351 else |
1352 error_ = error; | 1352 error_ = error; |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 params->tab_id | 2095 params->tab_id |
2096 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, | 2096 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, |
2097 base::IntToString(*params->tab_id)) | 2097 base::IntToString(*params->tab_id)) |
2098 : keys::kCannotFindTabToDiscard)); | 2098 : keys::kCannotFindTabToDiscard)); |
2099 } | 2099 } |
2100 | 2100 |
2101 TabsDiscardFunction::TabsDiscardFunction() {} | 2101 TabsDiscardFunction::TabsDiscardFunction() {} |
2102 TabsDiscardFunction::~TabsDiscardFunction() {} | 2102 TabsDiscardFunction::~TabsDiscardFunction() {} |
2103 | 2103 |
2104 } // namespace extensions | 2104 } // namespace extensions |
OLD | NEW |