Home | History | Annotate | Download | only in corewm
      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.
      4 
      5 #include "ui/views/corewm/tooltip_controller_test_helper.h"
      6 
      7 #include "ui/aura/window.h"
      8 #include "ui/views/corewm/tooltip_controller.h"
      9 
     10 namespace views {
     11 namespace corewm {
     12 namespace test {
     13 
     14 TooltipControllerTestHelper::TooltipControllerTestHelper(
     15     TooltipController* controller)
     16     : controller_(controller) {
     17 }
     18 
     19 TooltipControllerTestHelper::~TooltipControllerTestHelper() {
     20 }
     21 
     22 base::string16 TooltipControllerTestHelper::GetTooltipText() {
     23   return controller_->tooltip_text_;
     24 }
     25 
     26 aura::Window* TooltipControllerTestHelper::GetTooltipWindow() {
     27   return controller_->tooltip_window_;
     28 }
     29 
     30 void TooltipControllerTestHelper::FireTooltipTimer() {
     31   controller_->TooltipTimerFired();
     32 }
     33 
     34 bool TooltipControllerTestHelper::IsTooltipTimerRunning() {
     35   return controller_->tooltip_timer_.IsRunning();
     36 }
     37 
     38 void TooltipControllerTestHelper::FireTooltipShownTimer() {
     39   controller_->tooltip_shown_timer_.Stop();
     40   controller_->TooltipShownTimerFired();
     41 }
     42 
     43 bool TooltipControllerTestHelper::IsTooltipShownTimerRunning() {
     44   return controller_->tooltip_shown_timer_.IsRunning();
     45 }
     46 
     47 bool TooltipControllerTestHelper::IsTooltipVisible() {
     48   return controller_->IsTooltipVisible();
     49 }
     50 
     51 TooltipTestView::TooltipTestView() {
     52 }
     53 
     54 TooltipTestView::~TooltipTestView() {
     55 }
     56 
     57 bool TooltipTestView::GetTooltipText(const gfx::Point& p,
     58                                      base::string16* tooltip) const {
     59   *tooltip = tooltip_text_;
     60   return true;
     61 }
     62 
     63 }  // namespace test
     64 }  // namespace corewm
     65 }  // namespace views
     66