<commit_before>// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

#ifndef ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
#define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_

#include <map>
#include <memory>

#include "atom/browser/api/atom_api_menu.h"
#include "base/memory/weak_ptr.h"
#include "ui/display/screen.h"
#include "ui/views/controls/menu/menu_runner.h"

namespace atom {

namespace api {

class MenuViews : public Menu {
 public:
  MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper);

 protected:
  void PopupAt(
      Window* window, int x, int y, int positioning_item) override;
  void ClosePopupAt(int32_t window_id) override;

 private:
  // window ID -> open context menu
  std::map<int32_t, std::unique_ptr<views::MenuRunner>> menu_runners_;

  base::WeakPtrFactory<MenuViews> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(MenuViews);
};

}  // namespace api

}  // namespace atom

#endif  // ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
<commit_msg>Fix missing PopupAt overrides on windows/linux<commit_after>// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

#ifndef ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
#define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_

#include <map>
#include <memory>

#include "atom/browser/api/atom_api_menu.h"
#include "base/memory/weak_ptr.h"
#include "ui/display/screen.h"
#include "ui/views/controls/menu/menu_runner.h"

namespace atom {

namespace api {

class MenuViews : public Menu {
 public:
  MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper);

 protected:
  void PopupAt(
      Window* window, int x, int y, int positioning_item,
      CloseCallback callback) override;
  void ClosePopupAt(int32_t window_id) override;

 private:
  // window ID -> open context menu
  std::map<int32_t, std::unique_ptr<views::MenuRunner>> menu_runners_;

  base::WeakPtrFactory<MenuViews> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(MenuViews);
};

}  // namespace api

}  // namespace atom

#endif  // ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_

{'fraction_non_alphanumeric': 0.10672853828306264, 'fraction_numerical': 0.010208816705336427, 'mean_word_length': 4.972299168975069, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '352077', 'n_tokens_mistral': 819, 'n_tokens_neox': 778, 'n_words': 183}