Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / views / corewm / tooltip_controller_test_helper.h
blob60de9d7d04ba1480b7e028ff093701e8b0004e87
1 // Copyright (c) 2013 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.
5 #ifndef UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_TEST_HELPER_H_
6 #define UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_TEST_HELPER_H_
8 #include "base/logging.h"
9 #include "base/strings/string16.h"
10 #include "ui/views/view.h"
11 #include "ui/views/views_export.h"
13 namespace aura {
14 class Window;
17 namespace views {
18 namespace corewm {
20 class TooltipController;
22 namespace test {
24 // TooltipControllerTestHelper provides access to TooltipControllers private
25 // state.
26 class TooltipControllerTestHelper {
27 public:
28 explicit TooltipControllerTestHelper(TooltipController* controller);
29 ~TooltipControllerTestHelper();
31 TooltipController* controller() { return controller_; }
33 // These are mostly cover methods for TooltipController private methods.
34 base::string16 GetTooltipText();
35 aura::Window* GetTooltipWindow();
36 void FireTooltipTimer();
37 bool IsTooltipTimerRunning();
38 void FireTooltipShownTimer();
39 bool IsTooltipShownTimerRunning();
40 bool IsTooltipVisible();
42 private:
43 TooltipController* controller_;
45 DISALLOW_COPY_AND_ASSIGN(TooltipControllerTestHelper);
48 // Trivial View subclass that lets you set the tooltip text.
49 class TooltipTestView : public views::View {
50 public:
51 TooltipTestView();
52 ~TooltipTestView() override;
54 void set_tooltip_text(base::string16 tooltip_text) {
55 tooltip_text_ = tooltip_text;
58 // Overridden from views::View
59 bool GetTooltipText(const gfx::Point& p,
60 base::string16* tooltip) const override;
62 private:
63 base::string16 tooltip_text_;
65 DISALLOW_COPY_AND_ASSIGN(TooltipTestView);
69 } // namespace test
70 } // namespace corewm
71 } // namespace views
73 #endif // UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_TEST_HELPER_H_