forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Content Shell: LayoutTestJavaScriptDialogManager
This moves the DRT-specific parts of ShellJavaScriptDialogManager to a new, layout-test-only class. BUG=420994 R=jochen@chromium.org Review URL: https://codereview.chromium.org/639743002 Cr-Commit-Position: refs/heads/master@{#298709}
- Loading branch information
Showing
6 changed files
with
100 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
content/shell/browser/layout_test/layout_test_javascript_dialog_manager.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "content/shell/browser/layout_test/layout_test_javascript_dialog_manager.h" | ||
|
||
#include "base/command_line.h" | ||
#include "base/logging.h" | ||
#include "base/strings/utf_string_conversions.h" | ||
#include "content/public/browser/web_contents.h" | ||
#include "content/shell/browser/shell_javascript_dialog.h" | ||
#include "content/shell/browser/webkit_test_controller.h" | ||
#include "content/shell/common/shell_switches.h" | ||
#include "net/base/net_util.h" | ||
|
||
namespace content { | ||
|
||
LayoutTestJavaScriptDialogManager::LayoutTestJavaScriptDialogManager() { | ||
} | ||
|
||
LayoutTestJavaScriptDialogManager::~LayoutTestJavaScriptDialogManager() { | ||
} | ||
|
||
void LayoutTestJavaScriptDialogManager::RunJavaScriptDialog( | ||
WebContents* web_contents, | ||
const GURL& origin_url, | ||
const std::string& accept_lang, | ||
JavaScriptMessageType javascript_message_type, | ||
const base::string16& message_text, | ||
const base::string16& default_prompt_text, | ||
const DialogClosedCallback& callback, | ||
bool* did_suppress_message) { | ||
callback.Run(true, base::string16()); | ||
return; | ||
} | ||
|
||
void LayoutTestJavaScriptDialogManager::RunBeforeUnloadDialog( | ||
WebContents* web_contents, | ||
const base::string16& message_text, | ||
bool is_reload, | ||
const DialogClosedCallback& callback) { | ||
callback.Run(true, base::string16()); | ||
return; | ||
} | ||
|
||
} // namespace content |
43 changes: 43 additions & 0 deletions
43
content/shell/browser/layout_test/layout_test_javascript_dialog_manager.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_JAVASCRIPT_DIALOG_MANAGER_H_ | ||
#define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_JAVASCRIPT_DIALOG_MANAGER_H_ | ||
|
||
#include "base/callback_forward.h" | ||
#include "base/compiler_specific.h" | ||
#include "base/memory/scoped_ptr.h" | ||
#include "content/shell/browser/shell_javascript_dialog_manager.h" | ||
|
||
namespace content { | ||
|
||
class LayoutTestJavaScriptDialogManager : public ShellJavaScriptDialogManager { | ||
public: | ||
LayoutTestJavaScriptDialogManager(); | ||
virtual ~LayoutTestJavaScriptDialogManager(); | ||
|
||
// JavaScriptDialogManager: | ||
virtual void RunJavaScriptDialog( | ||
WebContents* web_contents, | ||
const GURL& origin_url, | ||
const std::string& accept_lang, | ||
JavaScriptMessageType javascript_message_type, | ||
const base::string16& message_text, | ||
const base::string16& default_prompt_text, | ||
const DialogClosedCallback& callback, | ||
bool* did_suppress_message) override; | ||
|
||
virtual void RunBeforeUnloadDialog( | ||
WebContents* web_contents, | ||
const base::string16& message_text, | ||
bool is_reload, | ||
const DialogClosedCallback& callback) override; | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(LayoutTestJavaScriptDialogManager); | ||
}; | ||
|
||
} // namespace content | ||
|
||
#endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_JAVASCRIPT_DIALOG_MANAGER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters