Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1308)

Unified Diff: ash/system/chromeos/session/tray_session_length_limit.h

Issue 2108793002: mash: Convert system tray logout button to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more review comments, fix mash_unittests Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/system/chromeos/session/tray_session_length_limit.h
diff --git a/ash/system/chromeos/session/tray_session_length_limit.h b/ash/system/chromeos/session/tray_session_length_limit.h
deleted file mode 100644
index a08492bc64cb9db266e72e44ba0e1ba2b17ddbeb..0000000000000000000000000000000000000000
--- a/ash/system/chromeos/session/tray_session_length_limit.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ASH_SYSTEM_CHROMEOS_SESSION_SESSION_LENGTH_LIMIT_H_
-#define ASH_SYSTEM_CHROMEOS_SESSION_SESSION_LENGTH_LIMIT_H_
-
-#include <memory>
-
-#include "ash/common/system/chromeos/session/session_length_limit_observer.h"
-#include "ash/common/system/tray/system_tray_item.h"
-#include "base/macros.h"
-#include "base/strings/string16.h"
-#include "base/time/time.h"
-#include "base/timer/timer.h"
-
-namespace ash {
-namespace test {
-class TraySessionLengthLimitTest;
-}
-
-class LabelTrayView;
-
-// Adds a countdown timer to the system tray if the session length is limited.
-class ASH_EXPORT TraySessionLengthLimit : public SystemTrayItem,
- public SessionLengthLimitObserver {
- public:
- enum LimitState { LIMIT_NONE, LIMIT_SET, LIMIT_EXPIRING_SOON };
-
- explicit TraySessionLengthLimit(SystemTray* system_tray);
- ~TraySessionLengthLimit() override;
-
- // SystemTrayItem:
- views::View* CreateDefaultView(LoginStatus status) override;
- void DestroyDefaultView() override;
-
- // SessionLengthLimitObserver:
- void OnSessionStartTimeChanged() override;
- void OnSessionLengthLimitChanged() override;
-
- private:
- friend class test::TraySessionLengthLimitTest;
-
- static const char kNotificationId[];
-
- // Update state, notification and tray bubble view. Called by the
- // RepeatingTimer in regular intervals and also by OnSession*Changed().
- void Update();
-
- // Recalculate |limit_state_| and |remaining_session_time_|.
- void UpdateState();
-
- void UpdateNotification();
- void UpdateTrayBubbleView() const;
-
- // These require that the state has been updated before.
- base::string16 ComposeNotificationMessage() const;
- base::string16 ComposeTrayBubbleMessage() const;
-
- base::TimeTicks session_start_time_;
- base::TimeDelta time_limit_;
- base::TimeDelta remaining_session_time_;
-
- LimitState limit_state_; // Current state.
- LimitState last_limit_state_; // State of last notification update.
-
- LabelTrayView* tray_bubble_view_;
- std::unique_ptr<base::RepeatingTimer> timer_;
-
- DISALLOW_COPY_AND_ASSIGN(TraySessionLengthLimit);
-};
-
-} // namespace ash
-
-#endif // ASH_SYSTEM_CHROMEOS_SESSION_SESSION_LENGTH_LIMIT_H_
« no previous file with comments | « ash/system/chromeos/session/logout_confirmation_dialog.cc ('k') | ash/system/chromeos/session/tray_session_length_limit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698