Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: chrome/browser/ui/webui/options/import_data_handler.cc

Issue 9693032: [uber page] Split up initialization of handlers from initialization of webui pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Initialize -> InitializeHandler, SendPageValues -> InitializePage Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698