mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
tests: Format with clang-tidy (see #3632)
This commit is contained in:
@@ -11,8 +11,7 @@
|
||||
#include "tests/cefclient/browser/test_runner.h"
|
||||
#include "tests/shared/browser/file_util.h"
|
||||
|
||||
namespace client {
|
||||
namespace dialog_test {
|
||||
namespace client::dialog_test {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -26,11 +25,11 @@ const char kFileSaveMessageName[] = "DialogTest.FileSave";
|
||||
// Store persistent dialog state information.
|
||||
class DialogState : public base::RefCountedThreadSafe<DialogState> {
|
||||
public:
|
||||
DialogState() : mode_(FILE_DIALOG_OPEN), pending_(false) {}
|
||||
DialogState() = default;
|
||||
|
||||
cef_file_dialog_mode_t mode_;
|
||||
cef_file_dialog_mode_t mode_ = FILE_DIALOG_OPEN;
|
||||
CefString last_file_;
|
||||
bool pending_;
|
||||
bool pending_ = false;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DialogState);
|
||||
};
|
||||
@@ -43,7 +42,7 @@ class DialogCallback : public CefRunFileDialogCallback {
|
||||
scoped_refptr<DialogState> dialog_state)
|
||||
: router_callback_(router_callback), dialog_state_(dialog_state) {}
|
||||
|
||||
virtual void OnFileDialogDismissed(
|
||||
void OnFileDialogDismissed(
|
||||
const std::vector<CefString>& file_paths) override {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
DCHECK(dialog_state_->pending_);
|
||||
@@ -63,11 +62,11 @@ class DialogCallback : public CefRunFileDialogCallback {
|
||||
|
||||
// Send a message back to the render process with the list of file paths.
|
||||
std::string response;
|
||||
for (int i = 0; i < static_cast<int>(file_paths.size()); ++i) {
|
||||
for (const auto& file_path : file_paths) {
|
||||
if (!response.empty()) {
|
||||
response += "|"; // Use a delimiter disallowed in file paths.
|
||||
}
|
||||
response += file_paths[i];
|
||||
response += file_path;
|
||||
}
|
||||
|
||||
router_callback_->Success(response);
|
||||
@@ -88,15 +87,15 @@ class DialogCallback : public CefRunFileDialogCallback {
|
||||
// Handle messages in the browser process.
|
||||
class Handler : public CefMessageRouterBrowserSide::Handler {
|
||||
public:
|
||||
Handler() {}
|
||||
Handler() = default;
|
||||
|
||||
// Called due to cefQuery execution in dialogs.html.
|
||||
virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
int64_t query_id,
|
||||
const CefString& request,
|
||||
bool persistent,
|
||||
CefRefPtr<Callback> callback) override {
|
||||
bool OnQuery(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
int64_t query_id,
|
||||
const CefString& request,
|
||||
bool persistent,
|
||||
CefRefPtr<Callback> callback) override {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
|
||||
// Only handle messages from the test URL.
|
||||
@@ -174,5 +173,4 @@ void CreateMessageHandlers(test_runner::MessageHandlerSet& handlers) {
|
||||
handlers.insert(new Handler());
|
||||
}
|
||||
|
||||
} // namespace dialog_test
|
||||
} // namespace client
|
||||
} // namespace client::dialog_test
|
||||
|
Reference in New Issue
Block a user