<commit_before>// Copyright (c) 2009 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 "chrome_frame/chrome_frame_delegate.h"

#include "chrome/common/automation_messages.h"

bool ChromeFrameDelegateImpl::IsTabMessage(const IPC::Message& message) {
  bool is_tab_message = true;
  IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, message)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationStateChanged, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_UpdateTargetUrl, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_HandleAccelerator, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabbedOut, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_OpenURL, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationFailed, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DidNavigate, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabLoaded, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_MoveWindow, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_ForwardMessageToExternalHost, )
    IPC_MESSAGE_HANDLER_GENERIC(
        AutomationMsg_ForwardContextMenuToExternalHost, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestStart, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestRead, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestEnd, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DownloadRequestInHost, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_SetCookieAsync, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_AttachExternalTab, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestGoToHistoryEntryOffset, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_GetCookiesFromHost, )
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_CloseExternalTab, )
    IPC_MESSAGE_UNHANDLED(is_tab_message = false);
  IPC_END_MESSAGE_MAP()

  return is_tab_message;
}

bool ChromeFrameDelegateImpl::OnMessageReceived(const IPC::Message& msg) {
  if (!IsValid()) {
    DLOG(WARNING) << __FUNCTION__
                  << " Msgs received for a NULL automation client instance";
    return false;
  }

  bool handled = true;
  IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, msg)<commit_msg>Add arguments in macros where required<commit_after>// Copyright (c) 2009 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 "chrome_frame/chrome_frame_delegate.h"

#include "chrome/common/automation_messages.h"

#define NO_CODE ((void)0)

bool ChromeFrameDelegateImpl::IsTabMessage(const IPC::Message& message) {
  bool is_tab_message = true;
  IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, message)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationStateChanged, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_UpdateTargetUrl, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_HandleAccelerator, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabbedOut, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_OpenURL, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationFailed, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DidNavigate, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabLoaded, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_MoveWindow, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(
        AutomationMsg_ForwardMessageToExternalHost, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(
        AutomationMsg_ForwardContextMenuToExternalHost, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestStart, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestRead, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestEnd, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DownloadRequestInHost, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_SetCookieAsync, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_AttachExternalTab, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(
        AutomationMsg_RequestGoToHistoryEntryOffset, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_GetCookiesFromHost, NO_CODE)
    IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_CloseExternalTab, NO_CODE)
    IPC_MESSAGE_UNHANDLED(is_tab_message = false);
  IPC_END_MESSAGE_MAP()

  return is_tab_message;
}

#undef NO_CODE

bool ChromeFrameDelegateImpl::OnMessageReceived(const IPC::Message& msg) {
  if (!IsValid()) {
    DLOG(WARNING) << __FUNCTION__
                  << " Msgs received for a NULL automation client instance";
    return false;
  }

  bool handled = true;
  IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, msg)
{'fraction_non_alphanumeric': 0.06057983556901774, 'fraction_numerical': 0.0019472090004327132, 'mean_word_length': 6.875638841567291, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4609851', 'n_tokens_mistral': 1574, 'n_tokens_neox': 1547, 'n_words': 213}