| 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 #ifdef CHROME_PERSONALIZATION | 5 #ifdef CHROME_PERSONALIZATION |
| 6 | 6 |
| 7 #include "chrome/browser/views/sync/sync_setup_wizard.h" | 7 #include "chrome/browser/views/sync/sync_setup_wizard.h" |
| 8 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); | 42 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); |
| 43 if (path_raw == chrome::kSyncThrobberPath) { | 43 if (path_raw == chrome::kSyncThrobberPath) { |
| 44 ResourceBundle::GetSharedInstance().LoadImageResourceBytes(IDR_THROBBER, | 44 ResourceBundle::GetSharedInstance().LoadImageResourceBytes(IDR_THROBBER, |
| 45 &html_bytes->data); | 45 &html_bytes->data); |
| 46 SendResponse(request_id, html_bytes); | 46 SendResponse(request_id, html_bytes); |
| 47 return; | 47 return; |
| 48 } | 48 } |
| 49 | 49 |
| 50 std::string response; | 50 std::string response; |
| 51 if (path_raw == chrome::kSyncGaiaLoginPath) { | 51 if (path_raw == chrome::kSyncGaiaLoginPath) { |
| 52 static const StringPiece html(ResourceBundle::GetSharedInstance() | 52 static const base::StringPiece html(ResourceBundle::GetSharedInstance() |
| 53 .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); | 53 .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); |
| 54 response = html.as_string(); | 54 response = html.as_string(); |
| 55 } else if (path_raw == chrome::kSyncMergeAndSyncPath) { | 55 } else if (path_raw == chrome::kSyncMergeAndSyncPath) { |
| 56 static const StringPiece html(ResourceBundle::GetSharedInstance() | 56 static const base::StringPiece html(ResourceBundle::GetSharedInstance() |
| 57 .GetRawDataResource(IDR_MERGE_AND_SYNC_HTML)); | 57 .GetRawDataResource(IDR_MERGE_AND_SYNC_HTML)); |
| 58 response = html.as_string(); | 58 response = html.as_string(); |
| 59 } else if (path_raw == chrome::kSyncSetupFlowPath) { | 59 } else if (path_raw == chrome::kSyncSetupFlowPath) { |
| 60 static const StringPiece html(ResourceBundle::GetSharedInstance() | 60 static const base::StringPiece html(ResourceBundle::GetSharedInstance() |
| 61 .GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML)); | 61 .GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML)); |
| 62 response = html.as_string(); | 62 response = html.as_string(); |
| 63 } | 63 } |
| 64 // Send the response. | 64 // Send the response. |
| 65 html_bytes->data.resize(response.size()); | 65 html_bytes->data.resize(response.size()); |
| 66 std::copy(response.begin(), response.end(), html_bytes->data.begin()); | 66 std::copy(response.begin(), response.end(), html_bytes->data.begin()); |
| 67 SendResponse(request_id, html_bytes); | 67 SendResponse(request_id, html_bytes); |
| 68 } | 68 } |
| 69 | 69 |
| 70 SyncSetupWizard::SyncSetupWizard(ProfileSyncService* service) | 70 SyncSetupWizard::SyncSetupWizard(ProfileSyncService* service) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // static | 114 // static |
| 115 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( | 115 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( |
| 116 State start_state) { | 116 State start_state) { |
| 117 State result = start_state == GAIA_LOGIN ? GAIA_SUCCESS : DONE; | 117 State result = start_state == GAIA_LOGIN ? GAIA_SUCCESS : DONE; |
| 118 DCHECK_NE(DONE, result) << | 118 DCHECK_NE(DONE, result) << |
| 119 "Invalid start state for discrete run: " << start_state; | 119 "Invalid start state for discrete run: " << start_state; |
| 120 return result; | 120 return result; |
| 121 } | 121 } |
| 122 | 122 |
| 123 #endif // CHROME_PERSONALIZATION | 123 #endif // CHROME_PERSONALIZATION |
| OLD | NEW |