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

Side by Side Diff: chrome/browser/ui/webui/settings/settings_import_data_handler.cc

Issue 2769383002: Firefox overlay is seen opened even if Import Overlay is Cancelled.
Patch Set: Fixed the Review Comments Created 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/settings/settings_import_data_handler.h" 5 #include "chrome/browser/ui/webui/settings/settings_import_data_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 web_ui()->RegisterMessageCallback( 63 web_ui()->RegisterMessageCallback(
64 "initializeImportDialog", 64 "initializeImportDialog",
65 base::Bind(&ImportDataHandler::InitializeDialog, base::Unretained(this))); 65 base::Bind(&ImportDataHandler::InitializeDialog, base::Unretained(this)));
66 web_ui()->RegisterMessageCallback( 66 web_ui()->RegisterMessageCallback(
67 "importData", 67 "importData",
68 base::Bind(&ImportDataHandler::ImportData, base::Unretained(this))); 68 base::Bind(&ImportDataHandler::ImportData, base::Unretained(this)));
69 web_ui()->RegisterMessageCallback( 69 web_ui()->RegisterMessageCallback(
70 "importFromBookmarksFile", 70 "importFromBookmarksFile",
71 base::Bind(&ImportDataHandler::HandleChooseBookmarksFile, 71 base::Bind(&ImportDataHandler::HandleChooseBookmarksFile,
72 base::Unretained(this))); 72 base::Unretained(this)));
73 web_ui()->RegisterMessageCallback(
74 "closeDialog",
Ilya Sherman 2017/03/27 15:21:52 Again, you'll want a more specific name, that expl
nikhil.sahni 2017/03/28 11:22:00 Done.
nikhil.sahni 2017/03/28 11:22:00 Done.
75 base::Bind(&ImportDataHandler::Close, base::Unretained(this)));
73 } 76 }
74 77
75 void ImportDataHandler::OnJavascriptDisallowed() { 78 void ImportDataHandler::OnJavascriptDisallowed() {
76 // Cancels outstanding profile list detections. 79 // Cancels outstanding profile list detections.
77 importer_list_.reset(); 80 importer_list_.reset();
78 81
79 // Stops listening to updates from any ongoing imports. 82 // Stops listening to updates from any ongoing imports.
80 if (importer_host_) 83 if (importer_host_)
81 importer_host_->set_observer(NULL); 84 importer_host_->set_observer(NULL);
82 } 85 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 138
136 uint16_t imported_items = (selected_items & supported_items); 139 uint16_t imported_items = (selected_items & supported_items);
137 if (imported_items) { 140 if (imported_items) {
138 StartImport(source_profile, imported_items); 141 StartImport(source_profile, imported_items);
139 } else { 142 } else {
140 LOG(WARNING) << "There were no settings to import from '" 143 LOG(WARNING) << "There were no settings to import from '"
141 << source_profile.importer_name << "'."; 144 << source_profile.importer_name << "'.";
142 } 145 }
143 } 146 }
144 147
148 void ImportDataHandler::Close(const base::ListValue* args) {
149 if (importer_host_)
150 importer_host_->NotifyImportEnded();
151 }
145 void ImportDataHandler::InitializeDialog(const base::ListValue* args) { 152 void ImportDataHandler::InitializeDialog(const base::ListValue* args) {
146 AllowJavascript(); 153 AllowJavascript();
147 154
148 CHECK_EQ(1U, args->GetSize()); 155 CHECK_EQ(1U, args->GetSize());
149 std::string callback_id; 156 std::string callback_id;
150 CHECK(args->GetString(0, &callback_id)); 157 CHECK(args->GetString(0, &callback_id));
151 158
152 importer_list_.reset(new ImporterList()); 159 importer_list_.reset(new ImporterList());
153 importer_list_->DetectSourceProfiles( 160 importer_list_->DetectSourceProfiles(
154 g_browser_process->GetApplicationLocale(), 161 g_browser_process->GetApplicationLocale(),
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 base::string16(), 254 base::string16(),
248 base::FilePath(), 255 base::FilePath(),
249 &file_type_info, 256 &file_type_info,
250 0, 257 0,
251 base::FilePath::StringType(), 258 base::FilePath::StringType(),
252 browser->window()->GetNativeWindow(), 259 browser->window()->GetNativeWindow(),
253 NULL); 260 NULL);
254 } 261 }
255 262
256 } // namespace settings 263 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698