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

Side by Side Diff: chrome/browser/notifications/extension_welcome_notification.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/notifications/extension_welcome_notification.h" 5 #include "chrome/browser/notifications/extension_welcome_notification.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void MarkAsDismissed() { 81 void MarkAsDismissed() {
82 profile_->GetPrefs()->SetBoolean(prefs::kWelcomeNotificationDismissedLocal, 82 profile_->GetPrefs()->SetBoolean(prefs::kWelcomeNotificationDismissedLocal,
83 true); 83 true);
84 } 84 }
85 85
86 void OpenNotificationLearnMoreTab() { 86 void OpenNotificationLearnMoreTab() {
87 chrome::NavigateParams params( 87 chrome::NavigateParams params(
88 profile_, 88 profile_,
89 GURL(chrome::kNotificationWelcomeLearnMoreURL), 89 GURL(chrome::kNotificationWelcomeLearnMoreURL),
90 ui::PAGE_TRANSITION_LINK); 90 ui::PAGE_TRANSITION_LINK);
91 params.disposition = NEW_FOREGROUND_TAB; 91 params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
92 params.window_action = chrome::NavigateParams::SHOW_WINDOW; 92 params.window_action = chrome::NavigateParams::SHOW_WINDOW;
93 chrome::Navigate(&params); 93 chrome::Navigate(&params);
94 } 94 }
95 95
96 void DisableNotificationProvider() { 96 void DisableNotificationProvider() {
97 message_center::Notifier notifier(notifier_id_, base::string16(), true); 97 message_center::Notifier notifier(notifier_id_, base::string16(), true);
98 message_center::MessageCenter* message_center = 98 message_center::MessageCenter* message_center =
99 delegate_->GetMessageCenter(); 99 delegate_->GetMessageCenter();
100 message_center->DisableNotificationsByNotifier(notifier_id_); 100 message_center->DisableNotificationsByNotifier(notifier_id_);
101 message_center->RemoveNotification(welcome_notification_id_, false); 101 message_center->RemoveNotification(welcome_notification_id_, false);
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 prefs::kWelcomeNotificationExpirationTimestamp, 352 prefs::kWelcomeNotificationExpirationTimestamp,
353 (delegate_->GetCurrentTime() + 353 (delegate_->GetCurrentTime() +
354 base::TimeDelta::FromDays(kRequestedShowTimeDays)).ToInternalValue()); 354 base::TimeDelta::FromDays(kRequestedShowTimeDays)).ToInternalValue());
355 } 355 }
356 356
357 bool ExtensionWelcomeNotification::IsWelcomeNotificationExpired() const { 357 bool ExtensionWelcomeNotification::IsWelcomeNotificationExpired() const {
358 const base::Time expiration_timestamp = GetExpirationTimestamp(); 358 const base::Time expiration_timestamp = GetExpirationTimestamp();
359 return !expiration_timestamp.is_null() && 359 return !expiration_timestamp.is_null() &&
360 (expiration_timestamp <= delegate_->GetCurrentTime()); 360 (expiration_timestamp <= delegate_->GetCurrentTime());
361 } 361 }
OLDNEW
« no previous file with comments | « chrome/browser/net/errorpage_browsertest.cc ('k') | chrome/browser/notifications/notification_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698