1// Copyright 2014 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#ifndef CHROME_BROWSER_CHROMEOS_UI_IDLE_APP_NAME_NOTIFICATION_VIEW_H_ 6#define CHROME_BROWSER_CHROMEOS_UI_IDLE_APP_NAME_NOTIFICATION_VIEW_H_ 7 8#include "base/memory/scoped_ptr.h" 9#include "base/strings/string16.h" 10 11namespace extensions { 12class Extension; 13} // namespace extensions 14 15namespace views { 16class Widget; 17} // namespace views 18 19namespace chromeos { 20 21class IdleAppNameNotificationDelegateView; 22 23// A class which creates a message which shows the currently running applicaion 24// name and its creator. 25class IdleAppNameNotificationView { 26 public: 27 // |message_visibility_time_in_ms| is the time the message is fully visible. 28 // |animation_time_ms| is the transition time for the message to show or hide. 29 // |extension| is the application which is started. 30 IdleAppNameNotificationView(int message_visibility_time_in_ms, 31 int animation_time_ms, 32 const extensions::Extension* extension); 33 virtual ~IdleAppNameNotificationView(); 34 35 // Close and destroy the message instantly. 36 void CloseMessage(); 37 38 // Returns true when message is shown. 39 bool IsVisible(); 40 41 // Returns the shown text for testing. 42 base::string16 GetShownTextForTest(); 43 44 private: 45 // Show the message. This will make the message visible. 46 void ShowMessage(int message_visibility_time_in_ms, 47 int animation_time_ms, 48 const extensions::Extension* extension); 49 50 // A reference to an existing message. 51 IdleAppNameNotificationDelegateView* view_; 52 53 DISALLOW_COPY_AND_ASSIGN(IdleAppNameNotificationView); 54}; 55 56} // namespace chromeos 57 58#endif // CHROME_BROWSER_CHROMEOS_UI_IDLE_APP_NAME_NOTIFICATION_VIEW_H_ 59