| OLD | NEW |
| 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_AUTO_LOGIN_PROMPTER_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTO_LOGIN_PROMPTER_H_ |
| 6 #define CHROME_BROWSER_UI_AUTO_LOGIN_PROMPTER_H_ | 6 #define CHROME_BROWSER_UI_AUTO_LOGIN_PROMPTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 public: | 30 public: |
| 31 typedef AutoLoginInfoBarDelegate::Params Params; | 31 typedef AutoLoginInfoBarDelegate::Params Params; |
| 32 | 32 |
| 33 // Looks for the X-Auto-Login response header in the request, and if found, | 33 // Looks for the X-Auto-Login response header in the request, and if found, |
| 34 // tries to display an infobar in the tab contents identified by the | 34 // tries to display an infobar in the tab contents identified by the |
| 35 // child/route id. | 35 // child/route id. |
| 36 static void ShowInfoBarIfPossible(net::URLRequest* request, | 36 static void ShowInfoBarIfPossible(net::URLRequest* request, |
| 37 int child_id, | 37 int child_id, |
| 38 int route_id); | 38 int route_id); |
| 39 | 39 |
| 40 // Returns whether parsing succeeded. |
| 41 static bool ParseAutoLoginHeader(const std::string& input, Params* output); |
| 42 |
| 40 private: | 43 private: |
| 41 friend class AutoLoginPrompterTest; | 44 friend class AutoLoginPrompterTest; |
| 42 | 45 |
| 43 AutoLoginPrompter(content::WebContents* web_contents, const Params& params); | 46 AutoLoginPrompter(content::WebContents* web_contents, const Params& params); |
| 44 | 47 |
| 45 virtual ~AutoLoginPrompter(); | 48 virtual ~AutoLoginPrompter(); |
| 46 | 49 |
| 47 static void ShowInfoBarUIThread(Params params, | 50 static void ShowInfoBarUIThread(Params params, |
| 48 const GURL& url, | 51 const GURL& url, |
| 49 int child_id, | 52 int child_id, |
| 50 int route_id); | 53 int route_id); |
| 51 | 54 |
| 52 // content::NotificationObserver override. | 55 // content::NotificationObserver override. |
| 53 virtual void Observe(int type, | 56 virtual void Observe(int type, |
| 54 const content::NotificationSource& source, | 57 const content::NotificationSource& source, |
| 55 const content::NotificationDetails& details) OVERRIDE; | 58 const content::NotificationDetails& details) OVERRIDE; |
| 56 | 59 |
| 57 // Returns whether parsing succeeded. | |
| 58 static bool ParseAutoLoginHeader(const std::string& input, Params* output); | |
| 59 | |
| 60 content::WebContents* web_contents_; | 60 content::WebContents* web_contents_; |
| 61 const Params params_; | 61 const Params params_; |
| 62 content::NotificationRegistrar registrar_; | 62 content::NotificationRegistrar registrar_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(AutoLoginPrompter); | 64 DISALLOW_COPY_AND_ASSIGN(AutoLoginPrompter); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 #endif // CHROME_BROWSER_UI_AUTO_LOGIN_PROMPTER_H_ | 67 #endif // CHROME_BROWSER_UI_AUTO_LOGIN_PROMPTER_H_ |
| OLD | NEW |