1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/process_singleton_modal_dialog_lock.h"
11 ProcessSingletonModalDialogLock::ProcessSingletonModalDialogLock(
12 const ProcessSingleton::NotificationCallback& original_callback)
13 : original_callback_(original_callback) {}
15 ProcessSingletonModalDialogLock::~ProcessSingletonModalDialogLock() {}
17 void ProcessSingletonModalDialogLock::SetModalDialogNotificationHandler(
18 base::Closure notification_handler) {
19 notification_handler_ = std::move(notification_handler);
22 ProcessSingleton::NotificationCallback
23 ProcessSingletonModalDialogLock::AsNotificationCallback() {
24 return base::Bind(&ProcessSingletonModalDialogLock::NotificationCallbackImpl,
25 base::Unretained(this));
28 bool ProcessSingletonModalDialogLock::NotificationCallbackImpl(
29 const base::CommandLine& command_line,
30 const base::FilePath& current_directory) {
31 if (notification_handler_)
32 notification_handler_.Run();
34 return original_callback_.Run(command_line, current_directory);