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

Side by Side Diff: chrome_frame/turndown_prompt/reshow_state.cc

Issue 17153006: Chrome Frame turndown prompt. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase to r208076 Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 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 "chrome_frame/turndown_prompt/reshow_state.h"
6
7 #include "base/win/registry.h"
8 #include "chrome_frame/utils.h"
9
10 namespace {
11
12 const wchar_t kTurndownPromptLastShown[] = L"TurndownPromptLastShown";
13
14 }
15
16 namespace turndown_prompt {
17
18 ReshowState::ReshowState(const base::TimeDelta& reshow_delta)
19 : reshow_delta_(reshow_delta) {
20 }
21
22 ReshowState::~ReshowState() {
23 }
24
25 bool ReshowState::HasReshowDeltaExpired(const base::Time& current_time) const {
26 int64 last_shown = GetConfigInt64(0LL, kTurndownPromptLastShown);
27 if (!last_shown)
28 return true;
29
30 base::Time last_shown_time(base::Time::FromInternalValue(last_shown));
31
32 return current_time - last_shown_time >= reshow_delta_;
33 }
34
35 void ReshowState::MarkShown(const base::Time& last_shown_time) {
36 SetConfigInt64(kTurndownPromptLastShown, last_shown_time.ToInternalValue());
37 }
38
39 } // namespace turndown_prompt
OLDNEW
« no previous file with comments | « chrome_frame/turndown_prompt/reshow_state.h ('k') | chrome_frame/turndown_prompt/turndown_prompt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698