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

Unified Diff: chrome/browser/extensions/api/identity/experimental_web_auth_flow.cc

Issue 14081014: Identity API: Change WebAuthFlow to use <webview> instead of a normal browser pop-up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chrome.identity side-by-side with chrome.experimental.identity Created 7 years, 7 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
Index: chrome/browser/extensions/api/identity/experimental_web_auth_flow.cc
diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.cc b/chrome/browser/extensions/api/identity/experimental_web_auth_flow.cc
similarity index 81%
copy from chrome/browser/extensions/api/identity/web_auth_flow.cc
copy to chrome/browser/extensions/api/identity/experimental_web_auth_flow.cc
index dd76b47244194855d01f6c31b50b4eb0c8e9122e..d1462170cf7a60de3be291eeed4c62c94b5578fb 100644
--- a/chrome/browser/extensions/api/identity/web_auth_flow.cc
+++ b/chrome/browser/extensions/api/identity/experimental_web_auth_flow.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/extensions/api/identity/web_auth_flow.h"
+#include "chrome/browser/extensions/api/identity/experimental_web_auth_flow.h"
#include "base/location.h"
#include "chrome/browser/profiles/profile.h"
@@ -28,7 +28,7 @@ using content::WebContentsObserver;
namespace extensions {
-WebAuthFlow::WebAuthFlow(
+ExperimentalWebAuthFlow::ExperimentalWebAuthFlow(
Delegate* delegate,
Profile* profile,
const GURL& provider_url,
@@ -45,7 +45,7 @@ WebAuthFlow::WebAuthFlow(
contents_(NULL) {
}
-WebAuthFlow::~WebAuthFlow() {
+ExperimentalWebAuthFlow::~ExperimentalWebAuthFlow() {
// Stop listening to notifications first since some of the code
// below may generate notifications.
registrar_.RemoveAll();
@@ -60,7 +60,7 @@ WebAuthFlow::~WebAuthFlow() {
}
}
-void WebAuthFlow::Start() {
+void ExperimentalWebAuthFlow::Start() {
contents_ = CreateWebContents();
WebContentsObserver::Observe(contents_);
@@ -80,11 +80,11 @@ void WebAuthFlow::Start() {
std::string());
}
-WebContents* WebAuthFlow::CreateWebContents() {
+WebContents* ExperimentalWebAuthFlow::CreateWebContents() {
return WebContents::Create(WebContents::CreateParams(profile_));
}
-void WebAuthFlow::ShowAuthFlowPopup() {
+void ExperimentalWebAuthFlow::ShowAuthFlowPopup() {
Browser::CreateParams browser_params(Browser::TYPE_POPUP, profile_,
host_desktop_type_);
browser_params.initial_bounds = initial_bounds_;
@@ -99,18 +99,18 @@ void WebAuthFlow::ShowAuthFlowPopup() {
popup_shown_ = true;
}
-void WebAuthFlow::BeforeUrlLoaded(const GURL& url) {
+void ExperimentalWebAuthFlow::BeforeUrlLoaded(const GURL& url) {
delegate_->OnAuthFlowURLChange(url);
}
-void WebAuthFlow::AfterUrlLoaded() {
+void ExperimentalWebAuthFlow::AfterUrlLoaded() {
// Do nothing if a popup is already created.
if (popup_shown_)
return;
// Report results directly if not in interactive mode.
- if (mode_ != WebAuthFlow::INTERACTIVE) {
- delegate_->OnAuthFlowFailure(WebAuthFlow::INTERACTION_REQUIRED);
+ if (mode_ != ExperimentalWebAuthFlow::INTERACTIVE) {
+ delegate_->OnAuthFlowFailure(ExperimentalWebAuthFlow::INTERACTION_REQUIRED);
return;
}
@@ -118,7 +118,7 @@ void WebAuthFlow::AfterUrlLoaded() {
ShowAuthFlowPopup();
}
-void WebAuthFlow::Observe(int type,
+void ExperimentalWebAuthFlow::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
@@ -136,19 +136,19 @@ void WebAuthFlow::Observe(int type,
}
}
-void WebAuthFlow::ProvisionalChangeToMainFrameUrl(
+void ExperimentalWebAuthFlow::ProvisionalChangeToMainFrameUrl(
const GURL& url,
RenderViewHost* render_view_host) {
BeforeUrlLoaded(url);
}
-void WebAuthFlow::DidStopLoading(RenderViewHost* render_view_host) {
+void ExperimentalWebAuthFlow::DidStopLoading(RenderViewHost* render_view_host) {
AfterUrlLoaded();
}
-void WebAuthFlow::WebContentsDestroyed(WebContents* web_contents) {
+void ExperimentalWebAuthFlow::WebContentsDestroyed(WebContents* web_contents) {
contents_ = NULL;
- delegate_->OnAuthFlowFailure(WebAuthFlow::WINDOW_CLOSED);
+ delegate_->OnAuthFlowFailure(ExperimentalWebAuthFlow::WINDOW_CLOSED);
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698