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

Unified Diff: chrome/browser/chromeos/notifications/system_notification_factory.cc

Issue 10947046: Eliminate kAshNotifyDisabled and SystemNotification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/notifications/system_notification_factory.cc
diff --git a/chrome/browser/chromeos/notifications/system_notification_factory.cc b/chrome/browser/chromeos/notifications/system_notification_factory.cc
deleted file mode 100644
index f0635d10249031aa0ce5caeca440f156d08128b6..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/notifications/system_notification_factory.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2011 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.
-
-#include "chrome/browser/chromeos/notifications/system_notification_factory.h"
-
-#include "base/utf_string_conversions.h"
-#include "chrome/browser/notifications/desktop_notification_service.h"
-#include "grit/browser_resources.h"
-#include "net/base/escape.h"
-
-namespace chromeos {
-
-using WebKit::WebTextDirection;
-
-// static
-Notification SystemNotificationFactory::Create(
- const GURL& icon, const string16& title,
- const string16& text,
- NotificationDelegate* delegate) {
- string16 content_url = DesktopNotificationService::CreateDataUrl(
- icon, title, text, WebKit::WebTextDirectionDefault);
- return Notification(GURL(), GURL(content_url), string16(), string16(),
- delegate);
-}
-
-// static
-Notification SystemNotificationFactory::Create(
- const GURL& icon, const string16& title,
- const string16& text, const string16& link,
- NotificationDelegate* delegate) {
- // Create an icon notification with or without a footer link
- // See code in DesktopNotificationService::CreateDataUrl
- WebTextDirection dir = WebKit::WebTextDirectionDefault;
- std::vector<std::string> subst;
- int resource = IDR_NOTIFICATION_ICON_HTML;
- subst.push_back(icon.spec());
- subst.push_back(net::EscapeForHTML(UTF16ToUTF8(title)));
- subst.push_back(net::EscapeForHTML(UTF16ToUTF8(text)));
- // icon float position
- subst.push_back(dir == WebKit::WebTextDirectionRightToLeft ?
- "right" : "left");
- // body text direction
- subst.push_back(dir == WebKit::WebTextDirectionRightToLeft ?
- "rtl" : "ltr");
- // if link is not empty, then use template with link
- if (!link.empty()) {
- resource = IDR_NOTIFICATION_ICON_LINK_HTML;
- subst.push_back(net::EscapeForHTML(UTF16ToUTF8(link)));
- }
-
- string16 content_url = DesktopNotificationService::CreateDataUrl(resource,
- subst);
- return Notification(GURL(), GURL(content_url), string16(), string16(),
- delegate);
-}
-
-} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698