Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs_api.cc

Issue 2434063002: Move extensions code from WebContents::GetURL to GetLastCommittedURL.
Patch Set: Refactor to simplify. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_tab_util.h » ('j') | chrome/browser/extensions/extension_tab_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698