summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-05 00:51:58 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-05 00:51:58 +0000
commitbd76fc2bcef23c62e570bdb67d782f4811a5f92d (patch)
tree0ece71dd45e5abe72bce4ecc9f12c1055238b3a2 /chrome/browser/notifications
parent103c215374c596425c599483053f69805720da71 (diff)
downloadchromium_src-bd76fc2bcef23c62e570bdb67d782f4811a5f92d.zip
chromium_src-bd76fc2bcef23c62e570bdb67d782f4811a5f92d.tar.gz
chromium_src-bd76fc2bcef23c62e570bdb67d782f4811a5f92d.tar.bz2
Spruce up the notification UI to much more closely match the mocks, including a new stylesheet from Glen for text+icon notifications, and little icons for the buttons.
Part of the CL includes new features for TextButton class to control icon placement and appearance on hover. BUG=none TEST=notifications Review URL: http://codereview.chromium.org/450045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications')
-rw-r--r--chrome/browser/notifications/balloon_collection.cc20
-rw-r--r--chrome/browser/notifications/desktop_notification_service.cc6
2 files changed, 14 insertions, 12 deletions
diff --git a/chrome/browser/notifications/balloon_collection.cc b/chrome/browser/notifications/balloon_collection.cc
index b0d2ea6..194ebdd 100644
--- a/chrome/browser/notifications/balloon_collection.cc
+++ b/chrome/browser/notifications/balloon_collection.cc
@@ -18,6 +18,10 @@ const double kPercentBalloonFillFactor = 0.7;
// Allow at least this number of balloons on the screen.
const int kMinAllowedBalloonCount = 2;
+// Margin from the edge of the work area
+const int kVerticalEdgeMargin = 5;
+const int kHorizontalEdgeMargin = 5;
+
} // namespace
// static
@@ -127,20 +131,20 @@ gfx::Point BalloonCollectionImpl::Layout::GetLayoutOrigin() const {
int y = 0;
switch (placement_) {
case HORIZONTALLY_FROM_BOTTOM_LEFT:
- x = work_area_.x();
- y = work_area_.bottom();
+ x = work_area_.x() + kHorizontalEdgeMargin;
+ y = work_area_.bottom() - kVerticalEdgeMargin;
break;
case HORIZONTALLY_FROM_BOTTOM_RIGHT:
- x = work_area_.right();
- y = work_area_.bottom();
+ x = work_area_.right() - kHorizontalEdgeMargin;
+ y = work_area_.bottom() - kVerticalEdgeMargin;
break;
case VERTICALLY_FROM_TOP_RIGHT:
- x = work_area_.right();
- y = work_area_.y();
+ x = work_area_.right() - kHorizontalEdgeMargin;
+ y = work_area_.y() + kVerticalEdgeMargin;
break;
case VERTICALLY_FROM_BOTTOM_RIGHT:
- x = work_area_.right();
- y = work_area_.bottom();
+ x = work_area_.right() - kHorizontalEdgeMargin;
+ y = work_area_.bottom() - kVerticalEdgeMargin;
break;
default:
NOTREACHED();
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index 8561440..bfe472d 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -61,11 +61,9 @@ static string16 CreateDataUrl(const GURL& icon_url, const string16& title,
subst.push_back(UTF8ToUTF16(EscapeForHTML(UTF16ToUTF8(body))));
if (icon_url.is_valid()) {
- subst.push_back(ASCIIToUTF16("block"));
- subst.push_back(ASCIIToUTF16("60"));
+ subst.push_back(ASCIIToUTF16("margin-left:56px;"));
} else {
- subst.push_back(ASCIIToUTF16("none"));
- subst.push_back(ASCIIToUTF16("5"));
+ subst.push_back(EmptyString16());
}
string16 format_string = ASCIIToUTF16("data:text/html;charset=utf-8,"