[M85 Dev][EFL] Fix errors to generate ninja files
[platform/framework/web/chromium-efl.git] / chrome / browser / process_singleton_modal_dialog_lock.h
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.
4
5 #ifndef CHROME_BROWSER_PROCESS_SINGLETON_MODAL_DIALOG_LOCK_H_
6 #define CHROME_BROWSER_PROCESS_SINGLETON_MODAL_DIALOG_LOCK_H_
7
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "chrome/browser/process_singleton.h"
11
12 namespace base {
13 class CommandLine;
14 class FilePath;
15 }
16
17 // Provides a ProcessSingleton::NotificationCallback that allows for closing a
18 // modal dialog that is active during startup. The client must ensure that
19 // SetModalDialogCallback is called appropriately when such dialogs are
20 // displayed or dismissed.
21 //
22 // After invoking the modal dialog's callback, this process will continue normal
23 // processing of the command line by forwarding the notification to a wrapped
24 // NotificationCallback.
25 class ProcessSingletonModalDialogLock {
26  public:
27   explicit ProcessSingletonModalDialogLock(
28       const ProcessSingleton::NotificationCallback& original_callback);
29
30   ~ProcessSingletonModalDialogLock();
31
32   // Receives a callback to be run to close the active modal dialog, or an empty
33   // closure if the active dialog is dismissed.
34   void SetModalDialogNotificationHandler(base::Closure notification_handler);
35
36   // Returns the ProcessSingleton::NotificationCallback.
37   // The callback is only valid during the lifetime of the
38   // ProcessSingletonModalDialogLock instance.
39   ProcessSingleton::NotificationCallback AsNotificationCallback();
40
41  private:
42   bool NotificationCallbackImpl(const base::CommandLine& command_line,
43                                 const base::FilePath& current_directory);
44
45   base::Closure notification_handler_;
46   ProcessSingleton::NotificationCallback original_callback_;
47
48   DISALLOW_COPY_AND_ASSIGN(ProcessSingletonModalDialogLock);
49 };
50
51 #endif  // CHROME_BROWSER_PROCESS_SINGLETON_MODAL_DIALOG_LOCK_H_