OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_MANAGER_H_ | 5 #ifndef COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_MANAGER_H_ |
6 #define COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_MANAGER_H_ | 6 #define COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_MANAGER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| 11 #include "base/time/time.h" |
11 #include "components/app_modal/javascript_app_modal_dialog.h" | 12 #include "components/app_modal/javascript_app_modal_dialog.h" |
12 #include "content/public/browser/javascript_dialog_manager.h" | 13 #include "content/public/browser/javascript_dialog_manager.h" |
13 | 14 |
14 namespace app_modal { | 15 namespace app_modal { |
15 | 16 |
16 class JavaScriptDialogExtensionsClient; | 17 class JavaScriptDialogExtensionsClient; |
17 class JavaScriptNativeDialogFactory; | 18 class JavaScriptNativeDialogFactory; |
18 | 19 |
19 class JavaScriptDialogManager : public content::JavaScriptDialogManager { | 20 class JavaScriptDialogManager : public content::JavaScriptDialogManager { |
20 public: | 21 public: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 bool success, | 74 bool success, |
74 const base::string16& user_input); | 75 const base::string16& user_input); |
75 | 76 |
76 // Mapping between the WebContents and their extra data. The key | 77 // Mapping between the WebContents and their extra data. The key |
77 // is a void* because the pointer is just a cookie and is never dereferenced. | 78 // is a void* because the pointer is just a cookie and is never dereferenced. |
78 JavaScriptAppModalDialog::ExtraDataMap javascript_dialog_extra_data_; | 79 JavaScriptAppModalDialog::ExtraDataMap javascript_dialog_extra_data_; |
79 | 80 |
80 scoped_ptr<JavaScriptNativeDialogFactory> native_dialog_factory_; | 81 scoped_ptr<JavaScriptNativeDialogFactory> native_dialog_factory_; |
81 scoped_ptr<JavaScriptDialogExtensionsClient> extensions_client_; | 82 scoped_ptr<JavaScriptDialogExtensionsClient> extensions_client_; |
82 | 83 |
| 84 // Record a single create and close timestamp to track the time between |
| 85 // dialogs. (Since Javascript dialogs are modal, this is even accurate!) |
| 86 base::TimeTicks last_close_time_; |
| 87 base::TimeTicks last_creation_time_; |
| 88 |
83 DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogManager); | 89 DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogManager); |
84 }; | 90 }; |
85 | 91 |
86 } // namespace app_modal | 92 } // namespace app_modal |
87 | 93 |
88 #endif // COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_MANAGER_H_ | 94 #endif // COMPONENTS_APP_MODAL_JAVASCRIPT_DIALOG_MANAGER_H_ |
OLD | NEW |