touch_selection_menu_runner.cc 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ui/touch_selection/touch_selection_menu_runner.h"
  5. #include "base/check_op.h"
  6. namespace ui {
  7. namespace {
  8. TouchSelectionMenuRunner* g_touch_selection_menu_runner = nullptr;
  9. } // namespace
  10. TouchSelectionMenuClient::TouchSelectionMenuClient() = default;
  11. TouchSelectionMenuClient::~TouchSelectionMenuClient() = default;
  12. base::WeakPtr<TouchSelectionMenuClient> TouchSelectionMenuClient::GetWeakPtr() {
  13. return weak_factory_.GetWeakPtr();
  14. }
  15. TouchSelectionMenuRunner::~TouchSelectionMenuRunner() {
  16. DCHECK_EQ(this, g_touch_selection_menu_runner);
  17. g_touch_selection_menu_runner = nullptr;
  18. }
  19. TouchSelectionMenuRunner* TouchSelectionMenuRunner::GetInstance() {
  20. return g_touch_selection_menu_runner;
  21. }
  22. TouchSelectionMenuRunner::TouchSelectionMenuRunner() {
  23. DCHECK(!g_touch_selection_menu_runner);
  24. g_touch_selection_menu_runner = this;
  25. }
  26. } // namespace ui