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

Side by Side Diff: ash/system/tray/tray_views.h

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, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/system/tray/tray_notification_view.cc ('k') | ash/system/tray/tray_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ 5 #ifndef ASH_SYSTEM_TRAY_TRAY_VIEWS_H_
6 #define ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ 6 #define ASH_SYSTEM_TRAY_TRAY_VIEWS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ash/ash_export.h" 9 #include "ash/ash_export.h"
10 #include "ui/gfx/font.h" 10 #include "ui/gfx/font.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // Overridden from views::View. 246 // Overridden from views::View.
247 virtual gfx::Size GetPreferredSize() OVERRIDE; 247 virtual gfx::Size GetPreferredSize() OVERRIDE;
248 virtual void Layout() OVERRIDE; 248 virtual void Layout() OVERRIDE;
249 249
250 views::View* content_; 250 views::View* content_;
251 views::View* button_container_; 251 views::View* button_container_;
252 views::Label* text_label_; 252 views::Label* text_label_;
253 DISALLOW_COPY_AND_ASSIGN(SpecialPopupRow); 253 DISALLOW_COPY_AND_ASSIGN(SpecialPopupRow);
254 }; 254 };
255 255
256 // A view for closable notification views, laid out like:
257 // -------------------
258 // | icon contents x |
259 // ----------------v--
260 // The close button will call OnClose() when clicked.
261 class TrayNotificationView : public views::View,
262 public views::ButtonListener {
263 public:
264 // If icon_id is 0, no icon image will be set. SetIconImage can be called
265 // to later set the icon image.
266 explicit TrayNotificationView(int icon_id);
267 virtual ~TrayNotificationView();
268
269 // InitView must be called once with the contents to be displayed.
270 void InitView(views::View* contents);
271
272 // Sets/updates the icon image.
273 void SetIconImage(const gfx::ImageSkia& image);
274
275 // Replaces the contents view.
276 void UpdateView(views::View* new_contents);
277
278 // Replaces the contents view and updates the icon image.
279 void UpdateViewAndImage(views::View* new_contents,
280 const gfx::ImageSkia& image);
281
282 // Overridden from ButtonListener.
283 virtual void ButtonPressed(views::Button* sender,
284 const views::Event& event) OVERRIDE;
285
286 protected:
287 // Called when the closed button is pressed.
288 virtual void OnClose() = 0;
289
290 private:
291 int icon_id_;
292 views::ImageView* icon_;
293
294 DISALLOW_COPY_AND_ASSIGN(TrayNotificationView);
295 };
296
297 // Sets up a Label properly for the tray (sets color, font etc.). 256 // Sets up a Label properly for the tray (sets color, font etc.).
298 void SetupLabelForTray(views::Label* label); 257 void SetupLabelForTray(views::Label* label);
299 258
300 } // namespace internal 259 } // namespace internal
301 } // namespace ash 260 } // namespace ash
302 261
303 #endif // ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ 262 #endif // ASH_SYSTEM_TRAY_TRAY_VIEWS_H_
OLDNEW
« no previous file with comments | « ash/system/tray/tray_notification_view.cc ('k') | ash/system/tray/tray_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698