OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webui/options/import_data_handler.h" | 5 #include "chrome/browser/ui/webui/options/import_data_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 { "noProfileFound", IDS_IMPORT_NO_PROFILE_FOUND }, | 52 { "noProfileFound", IDS_IMPORT_NO_PROFILE_FOUND }, |
53 { "importSucceeded", IDS_IMPORT_SUCCEEDED }, | 53 { "importSucceeded", IDS_IMPORT_SUCCEEDED }, |
54 { "findYourImportedBookmarks", IDS_IMPORT_FIND_YOUR_BOOKMARKS }, | 54 { "findYourImportedBookmarks", IDS_IMPORT_FIND_YOUR_BOOKMARKS }, |
55 }; | 55 }; |
56 | 56 |
57 RegisterStrings(localized_strings, resources, arraysize(resources)); | 57 RegisterStrings(localized_strings, resources, arraysize(resources)); |
58 RegisterTitle(localized_strings, "importDataOverlay", | 58 RegisterTitle(localized_strings, "importDataOverlay", |
59 IDS_IMPORT_SETTINGS_TITLE); | 59 IDS_IMPORT_SETTINGS_TITLE); |
60 } | 60 } |
61 | 61 |
62 void ImportDataHandler::Initialize() { | 62 void ImportDataHandler::InitializeHandler() { |
63 Profile* profile = Profile::FromWebUI(web_ui()); | 63 Profile* profile = Profile::FromWebUI(web_ui()); |
64 importer_list_ = new ImporterList(profile->GetRequestContext()); | 64 importer_list_ = new ImporterList(profile->GetRequestContext()); |
65 importer_list_->DetectSourceProfiles(this); | 65 importer_list_->DetectSourceProfiles(this); |
66 } | 66 } |
67 | 67 |
68 void ImportDataHandler::RegisterMessages() { | 68 void ImportDataHandler::RegisterMessages() { |
69 web_ui()->RegisterMessageCallback("importData", | 69 web_ui()->RegisterMessageCallback("importData", |
70 base::Bind(&ImportDataHandler::ImportData, base::Unretained(this))); | 70 base::Bind(&ImportDataHandler::ImportData, base::Unretained(this))); |
71 } | 71 } |
72 | 72 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 if (import_did_succeed_) { | 170 if (import_did_succeed_) { |
171 web_ui()->CallJavascriptFunction("ImportDataOverlay.confirmSuccess"); | 171 web_ui()->CallJavascriptFunction("ImportDataOverlay.confirmSuccess"); |
172 } else { | 172 } else { |
173 base::FundamentalValue state(false); | 173 base::FundamentalValue state(false); |
174 web_ui()->CallJavascriptFunction("ImportDataOverlay.setImportingState", | 174 web_ui()->CallJavascriptFunction("ImportDataOverlay.setImportingState", |
175 state); | 175 state); |
176 web_ui()->CallJavascriptFunction("ImportDataOverlay.dismiss"); | 176 web_ui()->CallJavascriptFunction("ImportDataOverlay.dismiss"); |
177 } | 177 } |
178 } | 178 } |
OLD | NEW |