OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 Browser* GetDesktopBrowser(); | 32 Browser* GetDesktopBrowser(); |
33 void SyncStarterCallback(OneClickSigninSyncStarter::SyncSetupResult result); | 33 void SyncStarterCallback(OneClickSigninSyncStarter::SyncSetupResult result); |
34 // Closes the current tab and shows the account management view of the avatar | 34 // Closes the current tab and shows the account management view of the avatar |
35 // bubble if |show_account_management| is true. | 35 // bubble if |show_account_management| is true. |
36 void CloseTab(bool show_account_management); | 36 void CloseTab(bool show_account_management); |
37 void HandleLoginError(const std::string& error_msg); | 37 void HandleLoginError(const std::string& error_msg); |
38 | 38 |
39 private: | 39 private: |
| 40 friend class InlineLoginUIBrowserTest; |
| 41 FRIEND_TEST_ALL_PREFIXES(InlineLoginUIBrowserTest, CanOfferNoProfile); |
| 42 FRIEND_TEST_ALL_PREFIXES(InlineLoginUIBrowserTest, CanOffer); |
| 43 FRIEND_TEST_ALL_PREFIXES(InlineLoginUIBrowserTest, CanOfferProfileConnected); |
| 44 FRIEND_TEST_ALL_PREFIXES(InlineLoginUIBrowserTest, |
| 45 CanOfferUsernameNotAllowed); |
| 46 FRIEND_TEST_ALL_PREFIXES(InlineLoginUIBrowserTest, CanOfferWithRejectedEmail); |
| 47 FRIEND_TEST_ALL_PREFIXES(InlineLoginUIBrowserTest, CanOfferNoSigninCookies); |
| 48 |
| 49 // Argument to CanOffer(). |
| 50 enum CanOfferFor { |
| 51 CAN_OFFER_FOR_ALL, |
| 52 CAN_OFFER_FOR_SECONDARY_ACCOUNT |
| 53 }; |
| 54 |
| 55 static bool CanOffer(Profile* profile, |
| 56 CanOfferFor can_offer_for, |
| 57 const std::string& email, |
| 58 std::string* error_message); |
| 59 |
40 // InlineLoginHandler overrides: | 60 // InlineLoginHandler overrides: |
41 void SetExtraInitParams(base::DictionaryValue& params) override; | 61 void SetExtraInitParams(base::DictionaryValue& params) override; |
42 void CompleteLogin(const base::ListValue* args) override; | 62 void CompleteLogin(const base::ListValue* args) override; |
43 | 63 |
44 // Overridden from content::WebContentsObserver overrides. | 64 // Overridden from content::WebContentsObserver overrides. |
45 void DidCommitProvisionalLoadForFrame( | 65 void DidCommitProvisionalLoadForFrame( |
46 content::RenderFrameHost* render_frame_host, | 66 content::RenderFrameHost* render_frame_host, |
47 const GURL& url, | 67 const GURL& url, |
48 ui::PageTransition transition_type) override; | 68 ui::PageTransition transition_type) override; |
49 | 69 |
50 // True if the user has navigated to untrusted domains during the signin | 70 // True if the user has navigated to untrusted domains during the signin |
51 // process. | 71 // process. |
52 bool confirm_untrusted_signin_; | 72 bool confirm_untrusted_signin_; |
53 | 73 |
54 base::WeakPtrFactory<InlineLoginHandlerImpl> weak_factory_; | 74 base::WeakPtrFactory<InlineLoginHandlerImpl> weak_factory_; |
55 | 75 |
56 DISALLOW_COPY_AND_ASSIGN(InlineLoginHandlerImpl); | 76 DISALLOW_COPY_AND_ASSIGN(InlineLoginHandlerImpl); |
57 }; | 77 }; |
58 | 78 |
59 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ | 79 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ |
OLD | NEW |