Title: [110903] trunk/Source
Revision
110903
Author
[email protected]
Date
2012-03-15 16:07:37 -0700 (Thu, 15 Mar 2012)

Log Message

Move NotificationContents into Notification
https://bugs.webkit.org/show_bug.cgi?id=80487
<rdar://problem/10965519>

Reviewed by Jian Li.

Source/WebCore:

* notifications/Notification.cpp: Alter signature of constructor to take the fields directly instead of
a NotificationContents instance.
(WebCore::Notification::Notification): Derive KURL from string representation of icon.
(WebCore::Notification::create):
* notifications/Notification.h:
(Notification): Remove contents() accessor and replace with get for title and body. iconURL()
already existed, but use local variable instead of going through NotificationContents.
(WebCore::Notification::iconURL):
(WebCore::Notification::title):
(WebCore::Notification::body):
* notifications/NotificationCenter.h:
(WebCore::NotificationCenter::createNotification): Refactor to use new constructor.
* notifications/NotificationContents.h: Removed.

Remove NotificationContents.h from project files
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit/chromium:

Refactor to use accessor methods on Notification.
* src/WebNotification.cpp:
(WebKit::WebNotification::title):
(WebKit::WebNotification::body):

Source/WebKit/mac:

* WebView/WebNotification.mm: Refactor to use accessor methods on Notification.
(-[WebNotification title]):
(-[WebNotification body]):

Source/WebKit/qt:

Refactor to use accessor methods on Notification.
* WebCoreSupport/NotificationPresenterClientQt.cpp:
(WebCore::NotificationWrapper::title):
(WebCore::NotificationWrapper::message):
(WebCore::NotificationPresenterClientQt::displayNotification):
(WebCore::NotificationPresenterClientQt::cancel):
(WebCore::NotificationPresenterClientQt::notificationClicked):
(WebCore::NotificationPresenterClientQt::dumpReplacedIdText):
(WebCore::NotificationPresenterClientQt::dumpShowText):

Source/WebKit2:

* UIProcess/Notifications/WebNotificationManagerProxy.cpp: Remove extraneous include.
* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::show): Refactor to use accessor methods on Notification.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (110902 => 110903)


--- trunk/Source/WebCore/ChangeLog	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebCore/ChangeLog	2012-03-15 23:07:37 UTC (rev 110903)
@@ -1,3 +1,32 @@
+2012-03-07  Jon Lee  <[email protected]>
+
+        Move NotificationContents into Notification
+        https://bugs.webkit.org/show_bug.cgi?id=80487
+        <rdar://problem/10965519>
+
+        Reviewed by Jian Li.
+
+        * notifications/Notification.cpp: Alter signature of constructor to take the fields directly instead of
+        a NotificationContents instance.
+        (WebCore::Notification::Notification): Derive KURL from string representation of icon.
+        (WebCore::Notification::create):
+        * notifications/Notification.h:
+        (Notification): Remove contents() accessor and replace with get for title and body. iconURL()
+        already existed, but use local variable instead of going through NotificationContents.
+        (WebCore::Notification::iconURL):
+        (WebCore::Notification::title):
+        (WebCore::Notification::body):
+        * notifications/NotificationCenter.h:
+        (WebCore::NotificationCenter::createNotification): Refactor to use new constructor.
+        * notifications/NotificationContents.h: Removed.
+
+        Remove NotificationContents.h from project files
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+
 2012-03-13  Jon Lee  <[email protected]>
 
         Deprecate ondisplay()

Modified: trunk/Source/WebCore/GNUmakefile.list.am (110902 => 110903)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-03-15 23:07:37 UTC (rev 110903)
@@ -2826,7 +2826,6 @@
 	Source/WebCore/notifications/NotificationCenter.cpp \
 	Source/WebCore/notifications/NotificationCenter.h \
 	Source/WebCore/notifications/NotificationClient.h \
-	Source/WebCore/notifications/NotificationContents.h \
 	Source/WebCore/notifications/NotificationController.cpp \
 	Source/WebCore/notifications/NotificationController.h \
 	Source/WebCore/notifications/Notification.cpp \

Modified: trunk/Source/WebCore/Target.pri (110902 => 110903)


--- trunk/Source/WebCore/Target.pri	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebCore/Target.pri	2012-03-15 23:07:37 UTC (rev 110903)
@@ -2076,7 +2076,6 @@
     notifications/Notification.h \
     notifications/NotificationCenter.h \
     notifications/NotificationClient.h \
-    notifications/NotificationContents.h \
     notifications/NotificationController.h \
     page/animation/AnimationBase.h \
     page/animation/AnimationController.h \

Modified: trunk/Source/WebCore/WebCore.gypi (110902 => 110903)


--- trunk/Source/WebCore/WebCore.gypi	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebCore/WebCore.gypi	2012-03-15 23:07:37 UTC (rev 110903)
@@ -209,7 +209,6 @@
             'Modules/webdatabase/StorageTracker.h',
             'Modules/webdatabase/StorageTrackerClient.h',
             'notifications/NotificationClient.h',
-            'notifications/NotificationContents.h',
             'notifications/NotificationController.h',
             'page/Chrome.h',
             'page/ChromeClient.h',

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (110902 => 110903)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-03-15 23:07:37 UTC (rev 110903)
@@ -53617,10 +53617,6 @@
 				RelativePath="..\notifications\NotificationClient.h"
 				>
 			</File>
-			<File
-				RelativePath="..\notifications\NotificationContents.h"
-				>
-			</File>
 		</Filter>
 		<Filter
 			Name="editing"

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (110902 => 110903)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-03-15 23:07:37 UTC (rev 110903)
@@ -925,7 +925,6 @@
 		33503CC71017A1B1003B47E1 /* Notification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33503CC61017A1B1003B47E1 /* Notification.cpp */; };
 		3390CA550FFC157B00921962 /* NotificationCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3390CA510FFC157B00921962 /* NotificationCenter.cpp */; };
 		3390CA560FFC157B00921962 /* NotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA520FFC157B00921962 /* NotificationCenter.h */; };
-		3390CA580FFC157B00921962 /* NotificationContents.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA540FFC157B00921962 /* NotificationContents.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		339B5B63131DAA3200F48D02 /* CookiesStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 339B5B62131DAA3200F48D02 /* CookiesStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		33C0CCD4112C5E6200CE057D /* SecureTextInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */; };
 		33C0CCD5112C5E6200CE057D /* SecureTextInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C0CCD3112C5E6200CE057D /* SecureTextInput.h */; };
@@ -7788,7 +7787,6 @@
 		3390CA510FFC157B00921962 /* NotificationCenter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NotificationCenter.cpp; path = notifications/NotificationCenter.cpp; sourceTree = "<group>"; };
 		3390CA520FFC157B00921962 /* NotificationCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotificationCenter.h; path = notifications/NotificationCenter.h; sourceTree = "<group>"; };
 		3390CA530FFC157B00921962 /* NotificationCenter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NotificationCenter.idl; path = notifications/NotificationCenter.idl; sourceTree = "<group>"; };
-		3390CA540FFC157B00921962 /* NotificationContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotificationContents.h; path = notifications/NotificationContents.h; sourceTree = "<group>"; };
 		339B5B62131DAA3200F48D02 /* CookiesStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookiesStrategy.h; sourceTree = "<group>"; };
 		33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecureTextInput.cpp; sourceTree = "<group>"; };
 		33C0CCD3112C5E6200CE057D /* SecureTextInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecureTextInput.h; sourceTree = "<group>"; };
@@ -14400,7 +14398,6 @@
 				3390CA520FFC157B00921962 /* NotificationCenter.h */,
 				3390CA530FFC157B00921962 /* NotificationCenter.idl */,
 				33503C9910179A74003B47E1 /* NotificationClient.h */,
-				3390CA540FFC157B00921962 /* NotificationContents.h */,
 				3128CA67147331520074C72A /* NotificationController.cpp */,
 				3128CA6A147331630074C72A /* NotificationController.h */,
 			);
@@ -23581,7 +23578,6 @@
 				A8EA7EBE0A1945D000A8EF5F /* Notation.h in Headers */,
 				312C0C41146DC6CC0016C911 /* Notification.h in Headers */,
 				3390CA560FFC157B00921962 /* NotificationCenter.h in Headers */,
-				3390CA580FFC157B00921962 /* NotificationContents.h in Headers */,
 				3128CA6B147331630074C72A /* NotificationController.h in Headers */,
 				33503C9A10179A74003B47E1 /* NotificationClient.h in Headers */,
 				98EB1F951313FE0500D0E1EA /* NotImplemented.h in Headers */,

Modified: trunk/Source/WebCore/notifications/Notification.cpp (110902 => 110903)


--- trunk/Source/WebCore/notifications/Notification.cpp	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebCore/notifications/Notification.cpp	2012-03-15 23:07:37 UTC (rev 110903)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2009, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -40,7 +40,6 @@
 #include "EventNames.h"
 #include "NotificationCenter.h"
 #include "NotificationClient.h"
-#include "NotificationContents.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
 #include "ThreadableLoader.h"
@@ -73,10 +72,11 @@
     m_notificationURL = url;
 }
 
-Notification::Notification(const NotificationContents& contents, ScriptExecutionContext* context, ExceptionCode& ec, PassRefPtr<NotificationCenter> provider)
+Notification::Notification(const String& title, const String& body, const String& iconURI, ScriptExecutionContext* context, ExceptionCode& ec, PassRefPtr<NotificationCenter> provider)
     : ActiveDOMObject(context, this)
     , m_isHTML(false)
-    , m_contents(contents)
+    , m_title(title)
+    , m_body(body)
     , m_state(Idle)
     , m_notificationCenter(provider)
 {
@@ -86,7 +86,8 @@
         return;
     }
 
-    if (!contents.icon.isEmpty() && !contents.icon.isValid()) {
+    m_icon = iconURI.isEmpty() ? KURL() : scriptExecutionContext()->completeURL(iconURI);
+    if (!m_icon.isEmpty() && !m_icon.isValid()) {
         ec = SYNTAX_ERR;
         return;
     }
@@ -107,9 +108,9 @@
     return notification.release();
 }
 
-PassRefPtr<Notification> Notification::create(const NotificationContents& contents, ScriptExecutionContext* context, ExceptionCode& ec, PassRefPtr<NotificationCenter> provider) 
+PassRefPtr<Notification> Notification::create(const String& title, const String& body, const String& iconURI, ScriptExecutionContext* context, ExceptionCode& ec, PassRefPtr<NotificationCenter> provider) 
 { 
-    RefPtr<Notification> notification(adoptRef(new Notification(contents, context, ec, provider)));
+    RefPtr<Notification> notification(adoptRef(new Notification(title, body, iconURI, context, ec, provider)));
     notification->suspendIfNeeded();
     return notification.release();
 }

Modified: trunk/Source/WebCore/notifications/Notification.h (110902 => 110903)


--- trunk/Source/WebCore/notifications/Notification.h	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebCore/notifications/Notification.h	2012-03-15 23:07:37 UTC (rev 110903)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2009, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -36,7 +36,6 @@
 #include "EventNames.h"
 #include "EventTarget.h"
 #include "KURL.h"
-#include "NotificationContents.h"
 #include "SharedBuffer.h"
 #include "TextDirection.h"
 #include "ThreadableLoaderClient.h"
@@ -62,7 +61,7 @@
 public:
     Notification();
     static PassRefPtr<Notification> create(const KURL&, ScriptExecutionContext*, ExceptionCode&, PassRefPtr<NotificationCenter> provider);
-    static PassRefPtr<Notification> create(const NotificationContents&, ScriptExecutionContext*, ExceptionCode&, PassRefPtr<NotificationCenter> provider);
+    static PassRefPtr<Notification> create(const String& title, const String& body, const String& iconURI, ScriptExecutionContext*, ExceptionCode&, PassRefPtr<NotificationCenter> provider);
     
     virtual ~Notification();
 
@@ -75,10 +74,9 @@
     KURL url() const { return m_notificationURL; }
     void setURL(KURL url) { m_notificationURL = url; }
     
-    KURL iconURL() { return m_contents.icon; }
-    
-    const NotificationContents& contents() const { return m_contents; }
-    NotificationContents& contents() { return m_contents; }
+    KURL iconURL() const { return m_icon; }
+    String title() const { return m_title; }
+    String body() const { return m_body; }
 
     String dir() const { return m_direction; }
     void setDir(const String& dir) { m_direction = dir; }
@@ -127,7 +125,7 @@
 
 private:
     Notification(const KURL&, ScriptExecutionContext*, ExceptionCode&, PassRefPtr<NotificationCenter>);
-    Notification(const NotificationContents&, ScriptExecutionContext*, ExceptionCode&, PassRefPtr<NotificationCenter>);
+    Notification(const String& title, const String& body, const String& iconURI, ScriptExecutionContext*, ExceptionCode&, PassRefPtr<NotificationCenter>);
 
     // EventTarget interface
     virtual void refEventTarget() { ref(); }
@@ -139,8 +137,13 @@
     void finishLoading();
 
     bool m_isHTML;
+
+    // Text notifications.
+    KURL m_icon;
+    String m_title;
+    String m_body;
+    // FIXME: Deprecate HTML Notifications.
     KURL m_notificationURL;
-    NotificationContents m_contents;
 
     String m_direction;
     String m_replaceId;

Modified: trunk/Source/WebCore/notifications/NotificationCenter.h (110902 => 110903)


--- trunk/Source/WebCore/notifications/NotificationCenter.h	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebCore/notifications/NotificationCenter.h	2012-03-15 23:07:37 UTC (rev 110903)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -34,7 +34,6 @@
 
 #include "ExceptionCode.h"
 #include "Notification.h"
-#include "NotificationContents.h"
 #include "ScriptExecutionContext.h"
 #include <wtf/OwnPtr.h>
 #include <wtf/PassRefPtr.h>
@@ -71,8 +70,7 @@
             ec = INVALID_STATE_ERR;
             return 0;
         }
-        NotificationContents contents(iconURI.isEmpty() ? KURL() : scriptExecutionContext()->completeURL(iconURI), title, body);
-        return Notification::create(contents, scriptExecutionContext(), ec, this);
+        return Notification::create(title, body, iconURI, scriptExecutionContext(), ec, this);
     }
 
     NotificationClient* client() const { return m_client; }

Deleted: trunk/Source/WebCore/notifications/NotificationContents.h (110902 => 110903)


--- trunk/Source/WebCore/notifications/NotificationContents.h	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebCore/notifications/NotificationContents.h	2012-03-15 23:07:37 UTC (rev 110903)
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef NotificationContents_h
-#define NotificationContents_h
-
-#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-
-#include "KURL.h"
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-struct NotificationContents { 
-public:
-    NotificationContents() { }
-    NotificationContents(const KURL& iconUrl, const String& notificationTitle, const String& notificationBody)
-        : icon(iconUrl)
-        , title(notificationTitle)
-        , body(notificationBody)
-    { }
-
-    KURL icon;
-    String title;
-    String body;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-
-#endif // NotificationContents_h

Modified: trunk/Source/WebKit/chromium/ChangeLog (110902 => 110903)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-03-15 23:07:37 UTC (rev 110903)
@@ -1,3 +1,16 @@
+2012-03-07  Jon Lee  <[email protected]>
+
+        Move NotificationContents into Notification
+        https://bugs.webkit.org/show_bug.cgi?id=80487
+        <rdar://problem/10965519>
+
+        Reviewed by Jian Li.
+
+        Refactor to use accessor methods on Notification.
+        * src/WebNotification.cpp:
+        (WebKit::WebNotification::title):
+        (WebKit::WebNotification::body):
+
 2012-03-13  Jon Lee  <[email protected]>
 
         Deprecate ondisplay()

Modified: trunk/Source/WebKit/chromium/src/WebNotification.cpp (110902 => 110903)


--- trunk/Source/WebKit/chromium/src/WebNotification.cpp	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebKit/chromium/src/WebNotification.cpp	2012-03-15 23:07:37 UTC (rev 110903)
@@ -88,13 +88,13 @@
 WebString WebNotification::title() const
 {
     ASSERT(!isHTML());
-    return m_private->contents().title;
+    return m_private->title();
 }
 
 WebString WebNotification::body() const
 {
     ASSERT(!isHTML());
-    return m_private->contents().body;
+    return m_private->body();
 }
 
 WebTextDirection WebNotification::direction() const

Modified: trunk/Source/WebKit/mac/ChangeLog (110902 => 110903)


--- trunk/Source/WebKit/mac/ChangeLog	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-03-15 23:07:37 UTC (rev 110903)
@@ -1,3 +1,15 @@
+2012-03-07  Jon Lee  <[email protected]>
+
+        Move NotificationContents into Notification
+        https://bugs.webkit.org/show_bug.cgi?id=80487
+        <rdar://problem/10965519>
+
+        Reviewed by Jian Li.
+
+        * WebView/WebNotification.mm: Refactor to use accessor methods on Notification.
+        (-[WebNotification title]):
+        (-[WebNotification body]):
+
 2012-03-15  David Hyatt  <[email protected]>
 
         https://bugs.webkit.org/show_bug.cgi?id=81258

Modified: trunk/Source/WebKit/mac/WebView/WebNotification.mm (110902 => 110903)


--- trunk/Source/WebKit/mac/WebView/WebNotification.mm	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebKit/mac/WebView/WebNotification.mm	2012-03-15 23:07:37 UTC (rev 110903)
@@ -85,7 +85,7 @@
 {
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
-    return core(self)->contents().title;
+    return core(self)->title();
 #else
     return nil;
 #endif
@@ -95,7 +95,7 @@
 {
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
-    return core(self)->contents().body;
+    return core(self)->body();
 #else
     return nil;
 #endif

Modified: trunk/Source/WebKit/qt/ChangeLog (110902 => 110903)


--- trunk/Source/WebKit/qt/ChangeLog	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebKit/qt/ChangeLog	2012-03-15 23:07:37 UTC (rev 110903)
@@ -1,3 +1,21 @@
+2012-03-07  Jon Lee  <[email protected]>
+
+        Move NotificationContents into Notification
+        https://bugs.webkit.org/show_bug.cgi?id=80487
+        <rdar://problem/10965519>
+
+        Reviewed by Jian Li.
+
+        Refactor to use accessor methods on Notification.
+        * WebCoreSupport/NotificationPresenterClientQt.cpp:
+        (WebCore::NotificationWrapper::title):
+        (WebCore::NotificationWrapper::message):
+        (WebCore::NotificationPresenterClientQt::displayNotification):
+        (WebCore::NotificationPresenterClientQt::cancel):
+        (WebCore::NotificationPresenterClientQt::notificationClicked):
+        (WebCore::NotificationPresenterClientQt::dumpReplacedIdText):
+        (WebCore::NotificationPresenterClientQt::dumpShowText):
+
 2012-03-13  Jon Lee  <[email protected]>
 
         Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS

Modified: trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp (110902 => 110903)


--- trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp	2012-03-15 23:07:37 UTC (rev 110903)
@@ -91,7 +91,7 @@
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
     if (notification)
-        return notification->contents().title;
+        return notification->title();
 #endif
     return QString();
 }
@@ -101,7 +101,7 @@
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
     if (notification)
-        return notification->contents().body;
+        return notification->body();
 #endif
     return QString();
 }
@@ -197,8 +197,8 @@
     if (notification->isHTML())
         message = notification->url().string();
     else {
-        title = notification->contents().title;
-        message = notification->contents().body;
+        title = notification->title();
+        message = notification->body();
     }
 
     if (m_platformPlugin.plugin() && m_platformPlugin.plugin()->supportsExtension(QWebKitPlatformPlugin::Notifications))
@@ -233,7 +233,7 @@
 #ifndef QT_NO_SYSTEMTRAYICON
     wrapper->connect(wrapper->m_notificationIcon.get(), SIGNAL(messageClicked()), wrapper, SLOT(notificationClicked()));
     wrapper->m_notificationIcon->show();
-    wrapper->m_notificationIcon->showMessage(notification->contents().title, notification->contents().body);
+    wrapper->m_notificationIcon->showMessage(notification->title(), notification->body());
 #endif
 }
 
@@ -243,7 +243,7 @@
         if (notification->isHTML())
             printf("DESKTOP NOTIFICATION CLOSED: %s\n", QString(notification->url().string()).toUtf8().constData());
         else
-            printf("DESKTOP NOTIFICATION CLOSED: %s\n", QString(notification->contents().title).toUtf8().constData());
+            printf("DESKTOP NOTIFICATION CLOSED: %s\n", QString(notification->title()).toUtf8().constData());
     }
 
     NotificationsQueue::Iterator iter = m_notifications.find(notification);
@@ -283,7 +283,7 @@
         if (notification->isHTML())
             notificationTitle = notification->url().string();
         else
-            notificationTitle = notification->contents().title;
+            notificationTitle = notification->title();
         if (notificationTitle == title)
             break;
         iter++;
@@ -423,7 +423,7 @@
 void NotificationPresenterClientQt::dumpReplacedIdText(Notification* notification)
 {
     if (notification)
-        printf("REPLACING NOTIFICATION %s\n", notification->isHTML() ? QString(notification->url().string()).toUtf8().constData() : QString(notification->contents().title).toUtf8().constData());
+        printf("REPLACING NOTIFICATION %s\n", notification->isHTML() ? QString(notification->url().string()).toUtf8().constData() : QString(notification->title()).toUtf8().constData());
 }
 
 void NotificationPresenterClientQt::dumpShowText(Notification* notification)
@@ -433,8 +433,8 @@
     else {
         printf("DESKTOP NOTIFICATION:%s icon %s, title %s, text %s\n",
                 notification->dir() == "rtl" ? "(RTL)" : "",
-            QString(notification->contents().icon.string()).toUtf8().constData(), QString(notification->contents().title).toUtf8().constData(),
-            QString(notification->contents().body).toUtf8().constData());
+            QString(notification->iconURL().string()).toUtf8().constData(), QString(notification->title()).toUtf8().constData(),
+            QString(notification->body()).toUtf8().constData());
     }
 }
 

Modified: trunk/Source/WebKit2/ChangeLog (110902 => 110903)


--- trunk/Source/WebKit2/ChangeLog	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebKit2/ChangeLog	2012-03-15 23:07:37 UTC (rev 110903)
@@ -1,3 +1,15 @@
+2012-03-07  Jon Lee  <[email protected]>
+
+        Move NotificationContents into Notification
+        https://bugs.webkit.org/show_bug.cgi?id=80487
+        <rdar://problem/10965519>
+
+        Reviewed by Jian Li.
+
+        * UIProcess/Notifications/WebNotificationManagerProxy.cpp: Remove extraneous include.
+        * WebProcess/Notifications/WebNotificationManager.cpp:
+        (WebKit::WebNotificationManager::show): Refactor to use accessor methods on Notification.
+
 2012-03-15  Brent Fulgham  <[email protected]>
 
         Unreviewed build correction. WinCairo export definitions

Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp (110902 => 110903)


--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp	2012-03-15 23:07:37 UTC (rev 110903)
@@ -33,7 +33,6 @@
 #include "WebNotificationManagerMessages.h"
 #include "WebPageProxy.h"
 #include "WebSecurityOrigin.h"
-#include <WebCore/NotificationContents.h>
 
 using namespace WTF;
 using namespace WebCore;

Modified: trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp (110902 => 110903)


--- trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp	2012-03-15 23:04:39 UTC (rev 110902)
+++ trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp	2012-03-15 23:07:37 UTC (rev 110903)
@@ -117,7 +117,7 @@
     NotificationContextMap::iterator it = m_notificationContextMap.add(notification->scriptExecutionContext(), Vector<uint64_t>()).first;
     it->second.append(notificationID);
     
-    m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->contents().title, notification->contents().body, notification->iconURL().string(), notification->replaceId(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
+    m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->replaceId(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
     return true;
 #else
     return false;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to