| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_SYNC_SYNC_SETUP_FLOW_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ |
| 6 #define CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ | 6 #define CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 // Triggers a state machine transition to advance_state. | 66 // Triggers a state machine transition to advance_state. |
| 67 void Advance(SyncSetupWizard::State advance_state); | 67 void Advance(SyncSetupWizard::State advance_state); |
| 68 | 68 |
| 69 // Focuses the dialog. This is useful in cases where the dialog has been | 69 // Focuses the dialog. This is useful in cases where the dialog has been |
| 70 // obscured by a browser window. | 70 // obscured by a browser window. |
| 71 void Focus(); | 71 void Focus(); |
| 72 | 72 |
| 73 // HtmlDialogUIDelegate implementation. | 73 // HtmlDialogUIDelegate implementation. |
| 74 // Get the HTML file path for the content to load in the dialog. | 74 // Get the HTML file path for the content to load in the dialog. |
| 75 virtual GURL GetDialogContentURL() const { | 75 virtual GURL GetDialogContentURL() const; |
| 76 return GURL("chrome://syncresources/setup"); | |
| 77 } | |
| 78 | 76 |
| 79 // HtmlDialogUIDelegate implementation. | 77 // HtmlDialogUIDelegate implementation. |
| 80 virtual void GetDOMMessageHandlers( | 78 virtual void GetDOMMessageHandlers( |
| 81 std::vector<DOMMessageHandler*>* handlers) const; | 79 std::vector<DOMMessageHandler*>* handlers) const; |
| 82 | 80 |
| 83 // HtmlDialogUIDelegate implementation. | 81 // HtmlDialogUIDelegate implementation. |
| 84 // Get the size of the dialog. | 82 // Get the size of the dialog. |
| 85 virtual void GetDialogSize(gfx::Size* size) const; | 83 virtual void GetDialogSize(gfx::Size* size) const; |
| 86 | 84 |
| 87 // HtmlDialogUIDelegate implementation. | 85 // HtmlDialogUIDelegate implementation. |
| 88 // Gets the JSON string input to use when opening the dialog. | 86 // Gets the JSON string input to use when opening the dialog. |
| 89 virtual std::string GetDialogArgs() const { | 87 virtual std::string GetDialogArgs() const; |
| 90 return dialog_start_args_; | |
| 91 } | |
| 92 | 88 |
| 93 // HtmlDialogUIDelegate implementation. | 89 // HtmlDialogUIDelegate implementation. |
| 94 // A callback to notify the delegate that the dialog closed. | 90 // A callback to notify the delegate that the dialog closed. |
| 95 virtual void OnDialogClosed(const std::string& json_retval); | 91 virtual void OnDialogClosed(const std::string& json_retval); |
| 96 | 92 |
| 97 // HtmlDialogUIDelegate implementation. | 93 // HtmlDialogUIDelegate implementation. |
| 98 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) { } | 94 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) {} |
| 99 | 95 |
| 100 // HtmlDialogUIDelegate implementation. | 96 // HtmlDialogUIDelegate implementation. |
| 101 virtual std::wstring GetDialogTitle() const { | 97 virtual std::wstring GetDialogTitle() const; |
| 102 return l10n_util::GetString(IDS_SYNC_MY_BOOKMARKS_LABEL); | |
| 103 } | |
| 104 | 98 |
| 105 // HtmlDialogUIDelegate implementation. | 99 // HtmlDialogUIDelegate implementation. |
| 106 virtual bool IsDialogModal() const { | 100 virtual bool IsDialogModal() const; |
| 107 return false; | 101 virtual bool ShouldShowDialogTitle() const; |
| 108 } | |
| 109 virtual bool ShouldShowDialogTitle() const { return true; } | |
| 110 | 102 |
| 111 void OnUserSubmittedAuth(const std::string& username, | 103 void OnUserSubmittedAuth(const std::string& username, |
| 112 const std::string& password, | 104 const std::string& password, |
| 113 const std::string& captcha, | 105 const std::string& captcha, |
| 114 const std::string& access_code); | 106 const std::string& access_code); |
| 115 | 107 |
| 116 void OnUserConfigured(const SyncConfiguration& configuration); | 108 void OnUserConfigured(const SyncConfiguration& configuration); |
| 117 | 109 |
| 118 void OnPassphraseEntry(const std::string& passphrase, | 110 void OnPassphraseEntry(const std::string& passphrase, |
| 119 const std::string& mode); | 111 const std::string& mode); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 } | 214 } |
| 223 | 215 |
| 224 private: | 216 private: |
| 225 void ExecuteJavascriptInIFrame(const std::wstring& iframe_xpath, | 217 void ExecuteJavascriptInIFrame(const std::wstring& iframe_xpath, |
| 226 const std::wstring& js); | 218 const std::wstring& js); |
| 227 SyncSetupFlow* flow_; | 219 SyncSetupFlow* flow_; |
| 228 DISALLOW_COPY_AND_ASSIGN(FlowHandler); | 220 DISALLOW_COPY_AND_ASSIGN(FlowHandler); |
| 229 }; | 221 }; |
| 230 | 222 |
| 231 #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ | 223 #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ |
| OLD | NEW |