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

Unified Diff: chrome/browser/extensions/extension_tab_util.cc

Issue 545973002: Cleaning up capture_web_contents_function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_tab_util.h ('k') | extensions/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_tab_util.cc
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index a5602ac1e8e43635a713db3c05f95697e1ef6357..fb51c2eb1c16989cc05a5a64dfa17a1618bb80f3 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -8,6 +8,7 @@
#include "base/strings/stringprintf.h"
#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
+#include "chrome/browser/extensions/chrome_extension_function_details.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/extensions/window_controller.h"
#include "chrome/browser/extensions/window_controller_list.h"
@@ -277,6 +278,26 @@ Browser* ExtensionTabUtil::GetBrowserFromWindowID(
}
}
+Browser* ExtensionTabUtil::GetBrowserFromWindowID(
+ const ChromeExtensionFunctionDetails& details,
+ int window_id,
+ std::string* error) {
+ if (window_id == extension_misc::kCurrentWindowId) {
+ Browser* result = details.GetCurrentBrowser();
+ if (!result || !result->window()) {
+ if (error)
+ *error = keys::kNoCurrentWindowError;
+ return NULL;
+ }
+ return result;
+ } else {
+ return GetBrowserInProfileWithId(details.GetProfile(),
+ window_id,
+ details.function()->include_incognito(),
+ error);
+ }
+}
+
int ExtensionTabUtil::GetWindowId(const Browser* browser) {
return browser->session_id().id();
}
« no previous file with comments | « chrome/browser/extensions/extension_tab_util.h ('k') | extensions/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698