Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Side by Side Diff: content/browser/tab_contents/tab_contents_delegate.cc

Issue 7096016: Remove JS dialog dependency from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: now a tc delegate Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/tab_contents/tab_contents_delegate.h" 5 #include "content/browser/tab_contents/tab_contents_delegate.h"
6 6
7 #include "base/compiler_specific.h"
8 #include "base/memory/singleton.h"
9 #include "content/browser/javascript_dialogs.h"
7 #include "content/common/url_constants.h" 10 #include "content/common/url_constants.h"
8 #include "ui/gfx/rect.h" 11 #include "ui/gfx/rect.h"
9 12
10 std::string TabContentsDelegate::GetNavigationHeaders(const GURL& url) { 13 std::string TabContentsDelegate::GetNavigationHeaders(const GURL& url) {
11 return std::string(); 14 return std::string();
12 } 15 }
13 16
14 void TabContentsDelegate::LoadProgressChanged(double progress) { 17 void TabContentsDelegate::LoadProgressChanged(double progress) {
15 } 18 }
16 19
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 TabContentsDelegate::MainFrameCommitDetails* 193 TabContentsDelegate::MainFrameCommitDetails*
191 TabContentsDelegate::CreateMainFrameCommitDetails(TabContents* tab) { 194 TabContentsDelegate::CreateMainFrameCommitDetails(TabContents* tab) {
192 return NULL; 195 return NULL;
193 } 196 }
194 197
195 void TabContentsDelegate::DidNavigateMainFramePostCommit( 198 void TabContentsDelegate::DidNavigateMainFramePostCommit(
196 TabContents* tab, 199 TabContents* tab,
197 const MainFrameCommitDetails& details) { 200 const MainFrameCommitDetails& details) {
198 } 201 }
199 202
203 // A stubbed-out version of JavaScriptDialogCreator that doesn't do anything.
204 class JavaScriptDialogCreatorStub : public content::JavaScriptDialogCreator {
205 public:
206 static JavaScriptDialogCreatorStub* GetInstance() {
207 return Singleton<JavaScriptDialogCreatorStub>::get();
208 }
209
210 virtual void RunJavaScriptDialog(content::JavaScriptDialogDelegate* delegate,
211 const GURL& frame_url,
212 int dialog_flags,
213 const string16& message_text,
214 const string16& default_prompt_text,
215 IPC::Message* reply_message,
216 bool* did_suppress_message,
217 Profile* profile) OVERRIDE {
218 *did_suppress_message = true;
219 }
220
221 virtual void RunBeforeUnloadDialog(
222 content::JavaScriptDialogDelegate* delegate,
223 const string16& message_text,
224 IPC::Message* reply_message) OVERRIDE {
225 delegate->OnDialogClosed(reply_message, true, string16());
226 }
227
228 virtual void ResetJavaScriptState(
229 content::JavaScriptDialogDelegate* delegate) OVERRIDE {
230 }
231 private:
232 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>;
233 };
234
235 content::JavaScriptDialogCreator*
236 TabContentsDelegate::GetJavaScriptDialogCreator() {
237 return JavaScriptDialogCreatorStub::GetInstance();
238 }
239
200 TabContentsDelegate::~TabContentsDelegate() { 240 TabContentsDelegate::~TabContentsDelegate() {
201 } 241 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698