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

Side by Side Diff: chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc

Issue 1292003004: Elide origins displayed on web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style nit Created 5 years, 4 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/ui/cocoa/apps/quit_with_apps_controller_mac.h" 5 #include "chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/i18n/number_formatting.h" 8 #include "base/i18n/number_formatting.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 message_center::RichNotificationData rich_notification_data; 60 message_center::RichNotificationData rich_notification_data;
61 rich_notification_data.buttons.push_back(quit_apps_button_info); 61 rich_notification_data.buttons.push_back(quit_apps_button_info);
62 if (!hosted_app_quit_notification_) { 62 if (!hosted_app_quit_notification_) {
63 message_center::ButtonInfo suppression_button_info( 63 message_center::ButtonInfo suppression_button_info(
64 l10n_util::GetStringUTF16(IDS_QUIT_WITH_APPS_SUPPRESSION_LABEL)); 64 l10n_util::GetStringUTF16(IDS_QUIT_WITH_APPS_SUPPRESSION_LABEL));
65 rich_notification_data.buttons.push_back(suppression_button_info); 65 rich_notification_data.buttons.push_back(suppression_button_info);
66 } 66 }
67 67
68 notification_.reset(new Notification( 68 notification_.reset(new Notification(
69 message_center::NOTIFICATION_TYPE_SIMPLE, 69 message_center::NOTIFICATION_TYPE_SIMPLE,
70 GURL(kQuitWithAppsOriginUrl),
71 l10n_util::GetStringUTF16(IDS_QUIT_WITH_APPS_TITLE), 70 l10n_util::GetStringUTF16(IDS_QUIT_WITH_APPS_TITLE),
72 l10n_util::GetStringUTF16(IDS_QUIT_WITH_APPS_EXPLANATION), 71 l10n_util::GetStringUTF16(IDS_QUIT_WITH_APPS_EXPLANATION),
73 ui::ResourceBundle::GetSharedInstance().GetImageNamed( 72 ui::ResourceBundle::GetSharedInstance().GetImageNamed(
74 IDR_PRODUCT_LOGO_128), 73 IDR_PRODUCT_LOGO_128),
75 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, 74 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
76 kQuitWithAppsNotificationID), 75 kQuitWithAppsNotificationID),
77 l10n_util::GetStringUTF16(IDS_QUIT_WITH_APPS_NOTIFICATION_DISPLAY_SOURCE), 76 l10n_util::GetStringUTF16(IDS_QUIT_WITH_APPS_NOTIFICATION_DISPLAY_SOURCE),
78 tag, 77 GURL(kQuitWithAppsOriginUrl), tag, rich_notification_data, this));
79 rich_notification_data,
80 this));
81 } 78 }
82 79
83 QuitWithAppsController::~QuitWithAppsController() {} 80 QuitWithAppsController::~QuitWithAppsController() {}
84 81
85 void QuitWithAppsController::Display() {} 82 void QuitWithAppsController::Display() {}
86 83
87 void QuitWithAppsController::Close(bool by_user) { 84 void QuitWithAppsController::Close(bool by_user) {
88 if (by_user) { 85 if (by_user) {
89 suppress_for_session_ = hosted_app_quit_notification_ ? false : true; 86 suppress_for_session_ = hosted_app_quit_notification_ ? false : true;
90 } 87 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 194
198 // Always return false, the notification UI can be used to quit all apps which 195 // Always return false, the notification UI can be used to quit all apps which
199 // will cause Chrome to quit. 196 // will cause Chrome to quit.
200 return false; 197 return false;
201 } 198 }
202 199
203 // static 200 // static
204 void QuitWithAppsController::RegisterPrefs(PrefRegistrySimple* registry) { 201 void QuitWithAppsController::RegisterPrefs(PrefRegistrySimple* registry) {
205 registry->RegisterBooleanPref(prefs::kNotifyWhenAppsKeepChromeAlive, true); 202 registry->RegisterBooleanPref(prefs::kNotifyWhenAppsKeepChromeAlive, true);
206 } 203 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698