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

Unified Diff: ash/system/web_notification/web_notification_tray.cc

Issue 10831159: Fix Ash status area bubble borders (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/tray/system_tray_bubble.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/web_notification/web_notification_tray.cc
diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc
index 823d3f4f16dfbb0afcdd051ade3248831965acfb..11c891cfb688cd0da6b6a91d140806f1ff94742d 100644
--- a/ash/system/web_notification/web_notification_tray.cc
+++ b/ash/system/web_notification/web_notification_tray.cc
@@ -482,12 +482,25 @@ class WebNotificationButtonView : public views::View,
class WebContentsView : public views::View {
public:
- WebContentsView() {}
+ explicit WebContentsView(WebNotificationTray* tray)
+ : tray_(tray) {
+ // TODO(stevenjb): Remove this border when TrayBubbleBorder is integrated
+ // with BubbleBorder.
+ int left = (tray->shelf_alignment() == SHELF_ALIGNMENT_LEFT) ? 0 : 1;
+ int right = (tray->shelf_alignment() == SHELF_ALIGNMENT_RIGHT) ? 0 : 1;
+ int bottom = (tray->shelf_alignment() == SHELF_ALIGNMENT_BOTTOM) ? 0 : 1;
+ set_border(views::Border::CreateSolidSidedBorder(
+ 1, left, bottom, right, ash::kBorderDarkColor));
+ set_notify_enter_exit_on_child(true);
+ }
virtual ~WebContentsView() {}
virtual void Update(
const WebNotificationList::Notifications& notifications) = 0;
+ protected:
+ WebNotificationTray* tray_;
+
private:
DISALLOW_COPY_AND_ASSIGN(WebContentsView);
};
@@ -495,10 +508,7 @@ class WebContentsView : public views::View {
class MessageCenterContentsView : public WebContentsView {
public:
explicit MessageCenterContentsView(WebNotificationTray* tray)
- : tray_(tray) {
- set_border(views::Border::CreateSolidSidedBorder(
- 1, 1, 1, 1, ash::kBorderDarkColor));
-
+ : WebContentsView(tray) {
SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1));
set_background(views::Background::CreateSolidBackground(kBackgroundColor));
@@ -542,7 +552,6 @@ class MessageCenterContentsView : public WebContentsView {
scroller_->SizeToPreferredSize();
}
- WebNotificationTray* tray_;
internal::FixedSizedScrollView* scroller_;
views::View* scroll_content_;
internal::WebNotificationButtonView* button_view_;
@@ -553,10 +562,7 @@ class MessageCenterContentsView : public WebContentsView {
class WebNotificationContentsView : public WebContentsView {
public:
explicit WebNotificationContentsView(WebNotificationTray* tray)
- : tray_(tray) {
- set_border(views::Border::CreateSolidSidedBorder(
- 1, 1, 1, 1, ash::kBorderDarkColor));
-
+ : WebContentsView(tray) {
SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1));
set_background(views::Background::CreateSolidBackground(kBackgroundColor));
@@ -577,7 +583,6 @@ class WebNotificationContentsView : public WebContentsView {
}
private:
- WebNotificationTray* tray_;
views::View* content_;
DISALLOW_COPY_AND_ASSIGN(WebNotificationContentsView);
« no previous file with comments | « ash/system/tray/system_tray_bubble.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698