| Index: chrome/browser/notifications/desktop_notification_service.cc
|
| diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
|
| index 848cc27d09d01ac3423bd052f076636812f7f907..d6699eea08e604ed809a7bbd0c89a903be173f38 100644
|
| --- a/chrome/browser/notifications/desktop_notification_service.cc
|
| +++ b/chrome/browser/notifications/desktop_notification_service.cc
|
| @@ -33,9 +33,6 @@
|
| #include "content/public/browser/render_view_host.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/common/show_desktop_notification_params.h"
|
| -#include "grit/browser_resources.h"
|
| -#include "net/base/escape.h"
|
| -#include "ui/base/resource/resource_bundle.h"
|
| #include "ui/base/webui/web_ui_util.h"
|
| #include "ui/message_center/notifier_settings.h"
|
|
|
| @@ -68,7 +65,6 @@ void CancelNotification(const std::string& id) {
|
|
|
| } // namespace
|
|
|
| -
|
| // DesktopNotificationService -------------------------------------------------
|
|
|
| // static
|
| @@ -84,60 +80,6 @@ void DesktopNotificationService::RegisterProfilePrefs(
|
| }
|
|
|
| // static
|
| -base::string16 DesktopNotificationService::CreateDataUrl(
|
| - const GURL& icon_url,
|
| - const base::string16& title,
|
| - const base::string16& body,
|
| - WebTextDirection dir) {
|
| - int resource;
|
| - std::vector<std::string> subst;
|
| - if (icon_url.is_valid()) {
|
| - resource = IDR_NOTIFICATION_ICON_HTML;
|
| - subst.push_back(icon_url.spec());
|
| - subst.push_back(net::EscapeForHTML(base::UTF16ToUTF8(title)));
|
| - subst.push_back(net::EscapeForHTML(base::UTF16ToUTF8(body)));
|
| - // icon float position
|
| - subst.push_back(dir == blink::WebTextDirectionRightToLeft ?
|
| - "right" : "left");
|
| - } else if (title.empty() || body.empty()) {
|
| - resource = IDR_NOTIFICATION_1LINE_HTML;
|
| - base::string16 line = title.empty() ? body : title;
|
| - // Strings are div names in the template file.
|
| - base::string16 line_name =
|
| - title.empty() ? base::ASCIIToUTF16("description")
|
| - : base::ASCIIToUTF16("title");
|
| - subst.push_back(net::EscapeForHTML(base::UTF16ToUTF8(line_name)));
|
| - subst.push_back(net::EscapeForHTML(base::UTF16ToUTF8(line)));
|
| - } else {
|
| - resource = IDR_NOTIFICATION_2LINE_HTML;
|
| - subst.push_back(net::EscapeForHTML(base::UTF16ToUTF8(title)));
|
| - subst.push_back(net::EscapeForHTML(base::UTF16ToUTF8(body)));
|
| - }
|
| - // body text direction
|
| - subst.push_back(dir == blink::WebTextDirectionRightToLeft ?
|
| - "rtl" : "ltr");
|
| -
|
| - return CreateDataUrl(resource, subst);
|
| -}
|
| -
|
| -// static
|
| -base::string16 DesktopNotificationService::CreateDataUrl(
|
| - int resource, const std::vector<std::string>& subst) {
|
| - const base::StringPiece template_html(
|
| - ResourceBundle::GetSharedInstance().GetRawDataResource(
|
| - resource));
|
| -
|
| - if (template_html.empty()) {
|
| - NOTREACHED() << "unable to load template. ID: " << resource;
|
| - return base::string16();
|
| - }
|
| -
|
| - std::string data = ReplaceStringPlaceholders(template_html, subst, NULL);
|
| - return base::UTF8ToUTF16("data:text/html;charset=utf-8," +
|
| - net::EscapeQueryParamValue(data, false));
|
| -}
|
| -
|
| -// static
|
| std::string DesktopNotificationService::AddIconNotification(
|
| const GURL& origin_url,
|
| const base::string16& title,
|
| @@ -153,12 +95,10 @@ std::string DesktopNotificationService::AddIconNotification(
|
| return notification.delegate_id();
|
| }
|
|
|
| -DesktopNotificationService::DesktopNotificationService(
|
| - Profile* profile,
|
| - NotificationUIManager* ui_manager)
|
| +DesktopNotificationService::DesktopNotificationService(Profile* profile)
|
| : PermissionContextBase(profile, CONTENT_SETTINGS_TYPE_NOTIFICATIONS),
|
| profile_(profile),
|
| - ui_manager_(ui_manager),
|
| + ui_manager_(NULL),
|
| extension_registry_observer_(this),
|
| weak_factory_(this) {
|
| OnStringListPrefChanged(
|
|
|