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 #include "components/app_modal_dialogs/javascript_app_modal_dialog.h" | 5 #include "components/app_modal_dialogs/javascript_app_modal_dialog.h" |
6 | 6 |
7 #include "components/app_modal_dialogs/javascript_dialog_manager_impl.h" | |
8 #include "components/app_modal_dialogs/javascript_native_dialog_factory.h" | |
7 #include "components/app_modal_dialogs/native_app_modal_dialog.h" | 9 #include "components/app_modal_dialogs/native_app_modal_dialog.h" |
msw
2014/11/05 03:53:55
I don't think this include is needed any more.
oshima
2014/11/05 21:42:18
Done.
| |
8 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
9 #include "ui/gfx/text_elider.h" | 11 #include "ui/gfx/text_elider.h" |
10 | 12 |
11 #if defined(USE_AURA) | 13 #if defined(USE_AURA) |
12 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
13 #include "ui/aura/window_event_dispatcher.h" | 15 #include "ui/aura/window_event_dispatcher.h" |
14 #endif | 16 #endif |
15 | 17 |
16 using content::JavaScriptDialogManager; | 18 using content::JavaScriptDialogManager; |
17 using content::WebContents; | 19 using content::WebContents; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 NativeAppModalDialog* JavaScriptAppModalDialog::CreateNativeDialog() { | 89 NativeAppModalDialog* JavaScriptAppModalDialog::CreateNativeDialog() { |
88 gfx::NativeWindow parent_window = web_contents()->GetTopLevelNativeWindow(); | 90 gfx::NativeWindow parent_window = web_contents()->GetTopLevelNativeWindow(); |
89 | 91 |
90 #if defined(USE_AURA) | 92 #if defined(USE_AURA) |
91 if (!parent_window->GetRootWindow()) { | 93 if (!parent_window->GetRootWindow()) { |
92 // When we are part of a WebContents that isn't actually being displayed on | 94 // When we are part of a WebContents that isn't actually being displayed on |
93 // the screen, we can't actually attach to it. | 95 // the screen, we can't actually attach to it. |
94 parent_window = NULL; | 96 parent_window = NULL; |
95 } | 97 } |
96 #endif // defined(USE_AURA) | 98 #endif // defined(USE_AURA) |
97 | 99 return JavaScriptDialogManagerImpl::GetInstance()->native_dialog_factory()-> |
98 return NativeAppModalDialog::CreateNativeJavaScriptPrompt(this, | 100 CreateNativeJavaScriptDialog(this, parent_window); |
99 parent_window); | |
100 } | 101 } |
101 | 102 |
102 bool JavaScriptAppModalDialog::IsJavaScriptModalDialog() { | 103 bool JavaScriptAppModalDialog::IsJavaScriptModalDialog() { |
103 return true; | 104 return true; |
104 } | 105 } |
105 | 106 |
106 void JavaScriptAppModalDialog::Invalidate() { | 107 void JavaScriptAppModalDialog::Invalidate() { |
107 if (!IsValid()) | 108 if (!IsValid()) |
108 return; | 109 return; |
109 | 110 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 if (extra_data != extra_data_map_->end()) { | 168 if (extra_data != extra_data_map_->end()) { |
168 extra_data->second.last_javascript_message_dismissal_ = | 169 extra_data->second.last_javascript_message_dismissal_ = |
169 base::TimeTicks::Now(); | 170 base::TimeTicks::Now(); |
170 extra_data->second.suppress_javascript_messages_ = suppress_js_messages; | 171 extra_data->second.suppress_javascript_messages_ = suppress_js_messages; |
171 } | 172 } |
172 | 173 |
173 // On Views, we can end up coming through this code path twice :(. | 174 // On Views, we can end up coming through this code path twice :(. |
174 // See crbug.com/63732. | 175 // See crbug.com/63732. |
175 AppModalDialog::Invalidate(); | 176 AppModalDialog::Invalidate(); |
176 } | 177 } |
OLD | NEW |