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

Side by Side Diff: chrome/browser/ui/webui/sync_promo/sync_promo_ui.h

Issue 12374007: signin: force web signin flow initiated visits to accounts.google.com to their own process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use extension-based scheme instead. Created 7 years, 9 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 | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_
7 7
8 #include "content/public/browser/web_ui_controller.h" 8 #include "content/public/browser/web_ui_controller.h"
9 9
10 class Profile; 10 class Profile;
(...skipping 10 matching lines...) Expand all
21 SOURCE_SETTINGS, 21 SOURCE_SETTINGS,
22 SOURCE_EXTENSION_INSTALL_BUBBLE, 22 SOURCE_EXTENSION_INSTALL_BUBBLE,
23 SOURCE_WEBSTORE_INSTALL, 23 SOURCE_WEBSTORE_INSTALL,
24 SOURCE_APP_LAUNCHER, 24 SOURCE_APP_LAUNCHER,
25 SOURCE_UNKNOWN, // This must be last. 25 SOURCE_UNKNOWN, // This must be last.
26 }; 26 };
27 27
28 // Constructs a SyncPromoUI. 28 // Constructs a SyncPromoUI.
29 explicit SyncPromoUI(content::WebUI* web_ui); 29 explicit SyncPromoUI(content::WebUI* web_ui);
30 30
31 // This is used to distinguish URLs belonging to the special web signin flow
32 // running in the special signin process from other URLs on the same domain.
33 // We do not grant WebUI privilieges / bindings to this process or to URLs of
34 // this scheme; enforcement of privileges is handled separately by
35 // OneClickSigninHelper.
36 static const char* kChromeSigninEffectiveURL;
37
31 // Returns true if the sync promo should be visible. 38 // Returns true if the sync promo should be visible.
32 // |profile| is the profile of the tab the promo would be shown on. 39 // |profile| is the profile of the tab the promo would be shown on.
33 static bool ShouldShowSyncPromo(Profile* profile); 40 static bool ShouldShowSyncPromo(Profile* profile);
34 41
35 // Returns true if we should show the sync promo at startup. 42 // Returns true if we should show the sync promo at startup.
36 static bool ShouldShowSyncPromoAtStartup(Profile* profile, 43 static bool ShouldShowSyncPromoAtStartup(Profile* profile,
37 bool is_new_profile); 44 bool is_new_profile);
38 45
39 // Called when the sync promo has been shown so that we can keep track 46 // Called when the sync promo has been shown so that we can keep track
40 // of the number of times we've displayed it. 47 // of the number of times we've displayed it.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 static bool GetAutoCloseForSyncPromoURL(const GURL& url); 79 static bool GetAutoCloseForSyncPromoURL(const GURL& url);
73 80
74 // Returns true if chrome should use the web-based sign in flow, false if 81 // Returns true if chrome should use the web-based sign in flow, false if
75 // chrome should use the ClientLogin flow. This function will return true 82 // chrome should use the ClientLogin flow. This function will return true
76 // only for platforms where |ENABLE_ONE_CLICK_SIGNIN| is defined. 83 // only for platforms where |ENABLE_ONE_CLICK_SIGNIN| is defined.
77 static bool UseWebBasedSigninFlow(); 84 static bool UseWebBasedSigninFlow();
78 85
79 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only. 86 // Forces UseWebBasedSigninFlow() to return true when set; used in tests only.
80 static void ForceWebBasedSigninFlowForTesting(bool force); 87 static void ForceWebBasedSigninFlowForTesting(bool force);
81 88
89 // Returns true if |url| is a web signin URL and should be hosted in an
90 // isolated, privileged signin process.
91 static bool IsWebBasedSigninFlowURL(const GURL& url);
92
82 private: 93 private:
83 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI); 94 DISALLOW_COPY_AND_ASSIGN(SyncPromoUI);
84 }; 95 };
85 96
86 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_ 97 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698