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

Unified Diff: chrome/browser/extensions/api/identity/web_auth_flow.h

Issue 10826078: Anti Phising UI for web auth flow window: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « no previous file | chrome/browser/extensions/api/identity/web_auth_flow.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/identity/web_auth_flow.h
===================================================================
--- chrome/browser/extensions/api/identity/web_auth_flow.h (revision 149223)
+++ chrome/browser/extensions/api/identity/web_auth_flow.h (working copy)
@@ -10,14 +10,18 @@
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
-#include "chrome/browser/ui/extensions/web_auth_flow_window.h"
-#include "content/public/browser/web_contents_delegate.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "googleurl/src/gurl.h"
+class Profile;
+class TabContents;
class WebAuthFlowTest;
namespace content {
-class BrowserContext;
+class NotificationDetails;
+class NotificationSource;
+class RenderViewHost;
class WebContents;
}
@@ -31,8 +35,7 @@
// The provider can show any UI to the user if needed before redirecting
// to an appropriate URL.
// TODO(munjal): Add link to the design doc here.
-class WebAuthFlow : public content::WebContentsDelegate,
- public WebAuthFlowWindow::Delegate {
+class WebAuthFlow : public content::NotificationObserver {
public:
enum Mode {
INTERACTIVE, // Show UI to the user if necessary.
@@ -57,7 +60,7 @@
// Creates an instance with the given parameters.
// Caller owns |delegate|.
WebAuthFlow(Delegate* delegate,
- content::BrowserContext* browser_context,
+ Profile* profile,
const std::string& extension_id,
const GURL& provider_url,
Mode mode);
@@ -69,36 +72,36 @@
protected:
virtual content::WebContents* CreateWebContents();
- virtual WebAuthFlowWindow* CreateAuthWindow();
+ virtual void ShowAuthFlowPopup();
private:
friend class ::WebAuthFlowTest;
- // WebContentsDelegate implementation.
- virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE;
- virtual void NavigationStateChanged(
- const content::WebContents* source, unsigned changed_flags) OVERRIDE;
+ // NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
- // WebAuthFlowWindow::Delegate implementation.
- virtual void OnClose() OVERRIDE;
+ bool BeforeUrlLoaded(const GURL& url);
+ void AfterUrlLoaded();
- void OnUrlLoaded();
// Reports the results back to the delegate.
- void ReportResult(const GURL& result);
+ void ReportResult(const GURL& url);
+ // Checks if |url| is a valid redirect URL for the extension.
+ bool IsValidRedirectUrl(const GURL& url) const;
// Helper to initialize valid extensions URLs vector.
void InitValidRedirectUrlPrefixes(const std::string& extension_id);
- // Checks if |url| is a valid redirect URL for the extension.
- bool IsValidRedirectUrl(const GURL& url) const;
Delegate* delegate_;
- content::BrowserContext* browser_context_;
+ Profile* profile_;
GURL provider_url_;
Mode mode_;
// List of valid redirect URL prefixes.
std::vector<std::string> valid_prefixes_;
content::WebContents* contents_;
- WebAuthFlowWindow* window_;
+ TabContents* tab_contents_;
+ content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(WebAuthFlow);
};
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/web_auth_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698