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 "content/public/browser/web_contents_delegate.h" | 5 #include "content/public/browser/web_contents_delegate.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "content/browser/javascript_dialogs.h" | 10 #include "content/browser/javascript_dialogs.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 const string16& default_prompt_text, | 139 const string16& default_prompt_text, |
140 IPC::Message* reply_message, | 140 IPC::Message* reply_message, |
141 bool* did_suppress_message) OVERRIDE { | 141 bool* did_suppress_message) OVERRIDE { |
142 *did_suppress_message = true; | 142 *did_suppress_message = true; |
143 } | 143 } |
144 | 144 |
145 virtual void RunBeforeUnloadDialog( | 145 virtual void RunBeforeUnloadDialog( |
146 JavaScriptDialogDelegate* delegate, | 146 JavaScriptDialogDelegate* delegate, |
147 const string16& message_text, | 147 const string16& message_text, |
148 IPC::Message* reply_message) OVERRIDE { | 148 IPC::Message* reply_message) OVERRIDE { |
149 delegate->OnDialogClosed(reply_message, true, string16()); | 149 // TODO(creis): Pass in the RVH that sent the request. |
| 150 delegate->OnDialogClosed(NULL, reply_message, true, string16()); |
150 } | 151 } |
151 | 152 |
152 virtual void ResetJavaScriptState( | 153 virtual void ResetJavaScriptState( |
153 JavaScriptDialogDelegate* delegate) OVERRIDE { | 154 JavaScriptDialogDelegate* delegate) OVERRIDE { |
154 } | 155 } |
155 private: | 156 private: |
156 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; | 157 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; |
157 }; | 158 }; |
158 | 159 |
159 JavaScriptDialogCreator* WebContentsDelegate::GetJavaScriptDialogCreator() { | 160 JavaScriptDialogCreator* WebContentsDelegate::GetJavaScriptDialogCreator() { |
(...skipping 24 matching lines...) Expand all Loading... |
184 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); | 185 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); |
185 attached_contents_.insert(web_contents); | 186 attached_contents_.insert(web_contents); |
186 } | 187 } |
187 | 188 |
188 void WebContentsDelegate::Detach(WebContents* web_contents) { | 189 void WebContentsDelegate::Detach(WebContents* web_contents) { |
189 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); | 190 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); |
190 attached_contents_.erase(web_contents); | 191 attached_contents_.erase(web_contents); |
191 } | 192 } |
192 | 193 |
193 } // namespace content | 194 } // namespace content |
OLD | NEW |