| 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 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 5 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 Callback callback); | 113 Callback callback); |
| 114 | 114 |
| 115 private: | 115 private: |
| 116 ConfirmEmailDialogDelegate(content::WebContents* contents, | 116 ConfirmEmailDialogDelegate(content::WebContents* contents, |
| 117 const std::string& last_email, | 117 const std::string& last_email, |
| 118 const std::string& email, | 118 const std::string& email, |
| 119 Callback callback); | 119 Callback callback); |
| 120 virtual ~ConfirmEmailDialogDelegate(); | 120 virtual ~ConfirmEmailDialogDelegate(); |
| 121 | 121 |
| 122 // TabModalConfirmDialogDelegate: | 122 // TabModalConfirmDialogDelegate: |
| 123 virtual base::string16 GetTitle() OVERRIDE; | 123 virtual base::string16 GetTitle() override; |
| 124 virtual base::string16 GetDialogMessage() OVERRIDE; | 124 virtual base::string16 GetDialogMessage() override; |
| 125 virtual base::string16 GetAcceptButtonTitle() OVERRIDE; | 125 virtual base::string16 GetAcceptButtonTitle() override; |
| 126 virtual base::string16 GetCancelButtonTitle() OVERRIDE; | 126 virtual base::string16 GetCancelButtonTitle() override; |
| 127 virtual base::string16 GetLinkText() const OVERRIDE; | 127 virtual base::string16 GetLinkText() const override; |
| 128 virtual void OnAccepted() OVERRIDE; | 128 virtual void OnAccepted() override; |
| 129 virtual void OnCanceled() OVERRIDE; | 129 virtual void OnCanceled() override; |
| 130 virtual void OnClosed() OVERRIDE; | 130 virtual void OnClosed() override; |
| 131 virtual void OnLinkClicked(WindowOpenDisposition disposition) OVERRIDE; | 131 virtual void OnLinkClicked(WindowOpenDisposition disposition) override; |
| 132 | 132 |
| 133 std::string last_email_; | 133 std::string last_email_; |
| 134 std::string email_; | 134 std::string email_; |
| 135 Callback callback_; | 135 Callback callback_; |
| 136 | 136 |
| 137 // Web contents from which the "Learn more" link should be opened. | 137 // Web contents from which the "Learn more" link should be opened. |
| 138 content::WebContents* web_contents_; | 138 content::WebContents* web_contents_; |
| 139 | 139 |
| 140 DISALLOW_COPY_AND_ASSIGN(ConfirmEmailDialogDelegate); | 140 DISALLOW_COPY_AND_ASSIGN(ConfirmEmailDialogDelegate); |
| 141 }; | 141 }; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 // Watch a webcontents and remove URL from the history once loading is complete. | 425 // Watch a webcontents and remove URL from the history once loading is complete. |
| 426 // We have to delay the cleaning until the new URL has finished loading because | 426 // We have to delay the cleaning until the new URL has finished loading because |
| 427 // we're not allowed to remove the last-loaded URL from the history. Objects | 427 // we're not allowed to remove the last-loaded URL from the history. Objects |
| 428 // of this type automatically self-destruct once they're finished their work. | 428 // of this type automatically self-destruct once they're finished their work. |
| 429 class CurrentHistoryCleaner : public content::WebContentsObserver { | 429 class CurrentHistoryCleaner : public content::WebContentsObserver { |
| 430 public: | 430 public: |
| 431 explicit CurrentHistoryCleaner(content::WebContents* contents); | 431 explicit CurrentHistoryCleaner(content::WebContents* contents); |
| 432 virtual ~CurrentHistoryCleaner(); | 432 virtual ~CurrentHistoryCleaner(); |
| 433 | 433 |
| 434 // content::WebContentsObserver: | 434 // content::WebContentsObserver: |
| 435 virtual void WebContentsDestroyed() OVERRIDE; | 435 virtual void WebContentsDestroyed() override; |
| 436 virtual void DidCommitProvisionalLoadForFrame( | 436 virtual void DidCommitProvisionalLoadForFrame( |
| 437 content::RenderFrameHost* render_frame_host, | 437 content::RenderFrameHost* render_frame_host, |
| 438 const GURL& url, | 438 const GURL& url, |
| 439 ui::PageTransition transition_type) OVERRIDE; | 439 ui::PageTransition transition_type) override; |
| 440 | 440 |
| 441 private: | 441 private: |
| 442 scoped_ptr<content::WebContents> contents_; | 442 scoped_ptr<content::WebContents> contents_; |
| 443 int history_index_to_remove_; | 443 int history_index_to_remove_; |
| 444 | 444 |
| 445 DISALLOW_COPY_AND_ASSIGN(CurrentHistoryCleaner); | 445 DISALLOW_COPY_AND_ASSIGN(CurrentHistoryCleaner); |
| 446 }; | 446 }; |
| 447 | 447 |
| 448 CurrentHistoryCleaner::CurrentHistoryCleaner(content::WebContents* contents) | 448 CurrentHistoryCleaner::CurrentHistoryCleaner(content::WebContents* contents) |
| 449 : WebContentsObserver(contents) { | 449 : WebContentsObserver(contents) { |
| (...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1581 // If the web contents is showing a blank page and not about to be closed, | 1581 // If the web contents is showing a blank page and not about to be closed, |
| 1582 // redirect to the NTP or apps page. | 1582 // redirect to the NTP or apps page. |
| 1583 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && | 1583 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && |
| 1584 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { | 1584 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { |
| 1585 RedirectToNtpOrAppsPage( | 1585 RedirectToNtpOrAppsPage( |
| 1586 web_contents(), | 1586 web_contents(), |
| 1587 signin::GetSourceForPromoURL(original_continue_url_)); | 1587 signin::GetSourceForPromoURL(original_continue_url_)); |
| 1588 } | 1588 } |
| 1589 } | 1589 } |
| 1590 } | 1590 } |
| OLD | NEW |