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

Unified Diff: ash/system/tray/tray_views.cc

Issue 10694043: Handle gesture events in notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + remove extra WS Created 8 years, 6 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/tray_views.h ('k') | ash/system/web_notification/web_notification_tray.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_views.cc
diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc
index 1ef58060c3bc149e9e0d260ded91131fb96a943c..a0edbe2e62d82de77165c7582c67a252b1561416 100644
--- a/ash/system/tray/tray_views.cc
+++ b/ash/system/tray/tray_views.cc
@@ -7,7 +7,6 @@
#include "ash/system/tray/tray_constants.h"
#include "grit/ash_strings.h"
#include "grit/ui_resources_standard.h"
-#include "grit/ui_resources_standard.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
@@ -512,98 +511,6 @@ void SpecialPopupRow::Layout() {
content_->SetBoundsRect(bounds);
}
-////////////////////////////////////////////////////////////////////////////////
-// TrayNotificationView
-
-TrayNotificationView::TrayNotificationView(int icon_id) : icon_id_(icon_id) {
-}
-
-TrayNotificationView::~TrayNotificationView() {
-}
-
-void TrayNotificationView::InitView(views::View* contents) {
- set_background(views::Background::CreateSolidBackground(kBackgroundColor));
-
- views::GridLayout* layout = new views::GridLayout(this);
- SetLayoutManager(layout);
-
- views::ImageButton* close_button = new views::ImageButton(this);
- close_button->SetImage(views::CustomButton::BS_NORMAL,
- ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
- IDR_AURA_WINDOW_CLOSE));
-
- icon_ = new views::ImageView;
- if (icon_id_ != 0) {
- icon_->SetImage(
- ResourceBundle::GetSharedInstance().GetImageSkiaNamed(icon_id_));
- }
-
- views::ColumnSet* columns = layout->AddColumnSet(0);
-
- columns->AddPaddingColumn(0, kTrayPopupPaddingHorizontal/2);
-
- // Icon
- columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER,
- 0, /* resize percent */
- views::GridLayout::FIXED,
- kNotificationIconWidth, kNotificationIconWidth);
-
- columns->AddPaddingColumn(0, kTrayPopupPaddingHorizontal/2);
-
- // Contents
- columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL,
- 0, /* resize percent */
- views::GridLayout::FIXED,
- kTrayNotificationContentsWidth,
- kTrayNotificationContentsWidth);
-
- columns->AddPaddingColumn(0, kTrayPopupPaddingHorizontal/2);
-
- // Close button
- columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER,
- 0, /* resize percent */
- views::GridLayout::FIXED,
- kNotificationIconWidth, kNotificationIconWidth);
-
- columns->AddPaddingColumn(0, kTrayPopupPaddingHorizontal/2);
-
- // Layout rows
- layout->AddPaddingRow(0, kTrayPopupPaddingBetweenItems);
- layout->StartRow(0, 0);
- layout->AddView(icon_);
- layout->AddView(contents);
- layout->AddView(close_button);
- layout->AddPaddingRow(0, kTrayPopupPaddingBetweenItems);
-}
-
-void TrayNotificationView::SetIconImage(const gfx::ImageSkia& image) {
- icon_->SetImage(image);
- SchedulePaint();
-}
-
-void TrayNotificationView::UpdateView(views::View* new_contents) {
- RemoveAllChildViews(true);
- InitView(new_contents);
- Layout();
- PreferredSizeChanged();
- SchedulePaint();
-}
-
-void TrayNotificationView::UpdateViewAndImage(views::View* new_contents,
- const gfx::ImageSkia& image) {
- RemoveAllChildViews(true);
- InitView(new_contents);
- icon_->SetImage(image);
- Layout();
- PreferredSizeChanged();
- SchedulePaint();
-}
-
-void TrayNotificationView::ButtonPressed(views::Button* sender,
- const views::Event& event) {
- OnClose();
-}
-
void SetupLabelForTray(views::Label* label) {
label->SetFont(
label->font().DeriveFont(2, gfx::Font::BOLD));
« no previous file with comments | « ash/system/tray/tray_views.h ('k') | ash/system/web_notification/web_notification_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698