Commit bb9ae6a9 authored by David Jacobo's avatar David Jacobo Committed by Commit Bot

s/tab/web_contents in ArcExternalProtocolDialog

Making var names consistent accross ArcExternalProtocolDialog. Also a
couple of style fixes for params comments.

Bug: None
Change-Id: Iae821c8d3a30e9e6886cda9f380dc050ceba9ef5
Tets: Build
Reviewed-on: https://chromium-review.googlesource.com/1069715Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Commit-Queue: David Jacobo <djacobo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561707}
parent 24e4ff54
......@@ -243,15 +243,15 @@ GetActionResult GetAction(
// Mark as not "safe" (aka return false) on the contrary, most likely those
// cases will require the user to pass thru the intent picker UI.
bool GetAndResetSafeToRedirectToArcWithoutUserConfirmationFlag(
WebContents* tab) {
WebContents* web_contents) {
const char* key =
arc::ArcWebContentsData::ArcWebContentsData::kArcTransitionFlag;
arc::ArcWebContentsData* arc_data =
static_cast<arc::ArcWebContentsData*>(tab->GetUserData(key));
static_cast<arc::ArcWebContentsData*>(web_contents->GetUserData(key));
if (!arc_data)
return false;
tab->RemoveUserData(key);
web_contents->RemoveUserData(key);
return true;
}
......@@ -579,8 +579,9 @@ GURL GetUrlToNavigateOnDeactivateForTesting(
}
bool GetAndResetSafeToRedirectToArcWithoutUserConfirmationFlagForTesting(
WebContents* tab) {
return GetAndResetSafeToRedirectToArcWithoutUserConfirmationFlag(tab);
WebContents* web_contents) {
return GetAndResetSafeToRedirectToArcWithoutUserConfirmationFlag(
web_contents);
}
bool IsChromeAnAppCandidateForTesting(
......
......@@ -62,7 +62,7 @@ GURL GetUrlToNavigateOnDeactivateForTesting(
const std::vector<mojom::IntentHandlerInfoPtr>& handlers);
bool GetAndResetSafeToRedirectToArcWithoutUserConfirmationFlagForTesting(
content::WebContents* tab);
content::WebContents* web_contents);
bool IsChromeAnAppCandidateForTesting(
const std::vector<mojom::IntentHandlerInfoPtr>& handlers);
......
......@@ -26,21 +26,21 @@ class ArcExternalProtocolDialogTestUtils : public BrowserWithTestWindowTest {
void CreateTab(bool started_from_arc) {
AddTab(browser(), GURL("http://www.tests.com"));
tab_ = browser()->tab_strip_model()->GetWebContentsAt(0);
web_contents_ = browser()->tab_strip_model()->GetWebContentsAt(0);
if (started_from_arc) {
tab_->SetUserData(&arc::ArcWebContentsData::kArcTransitionFlag,
std::make_unique<arc::ArcWebContentsData>());
web_contents_->SetUserData(&arc::ArcWebContentsData::kArcTransitionFlag,
std::make_unique<arc::ArcWebContentsData>());
}
}
bool WasTabStartedFromArc() {
return GetAndResetSafeToRedirectToArcWithoutUserConfirmationFlagForTesting(
tab_);
web_contents_);
}
private:
// Keep only one |WebContents| at a time.
content::WebContents* tab_;
content::WebContents* web_contents_;
DISALLOW_COPY_AND_ASSIGN(ArcExternalProtocolDialogTestUtils);
};
......@@ -860,7 +860,7 @@ TEST(ArcExternalProtocolDialogTest,
// Checks that the flag is correctly attached to the current tab.
TEST_F(ArcExternalProtocolDialogTestUtils, TestTabIsStartedFromArc) {
CreateTab(true /* started_from_arc */);
CreateTab(/*started_from_arc=*/true);
EXPECT_TRUE(WasTabStartedFromArc());
}
......@@ -868,7 +868,7 @@ TEST_F(ArcExternalProtocolDialogTestUtils, TestTabIsStartedFromArc) {
// Tests the same as the previous, just for when the data is not attached to the
// tab.
TEST_F(ArcExternalProtocolDialogTestUtils, TestTabIsNotStartedFromArc) {
CreateTab(false /* started_from_arc */);
CreateTab(/*started_from_arc=*/false);
EXPECT_FALSE(WasTabStartedFromArc());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment