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

Side by Side Diff: chrome/browser/notifications/balloon.cc

Issue 338051: Adds UI components for desktop notifications, including balloon view classes ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: use notused.png resources for try servers Created 11 years, 1 month 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/notifications/balloon.h"
6
7 #include "base/gfx/rect.h"
8 #include "base/logging.h"
9 #include "chrome/browser/notifications/balloon_collection.h"
10 #include "chrome/browser/renderer_host/site_instance.h"
11
12 Balloon::Balloon(const Notification& notification, Profile* profile,
13 BalloonCloseListener* listener)
14 : profile_(profile),
15 notification_(notification),
16 close_listener_(listener) {
17 }
18
19 Balloon::~Balloon() {
20 }
21
22 void Balloon::SetPosition(const gfx::Point& upper_left, bool reposition) {
23 position_ = upper_left;
24 if (reposition && balloon_view_.get())
25 balloon_view_->RepositionToBalloon();
26 }
27
28 void Balloon::set_view(BalloonView* balloon_view) {
29 balloon_view_.reset(balloon_view);
30 }
31
32 void Balloon::Show() {
33 notification_.Display();
34 if (balloon_view_.get()) {
35 balloon_view_->Show(this);
36 }
37 }
38
39 void Balloon::Close(bool by_user) {
40 notification_.Close(by_user);
41 if (close_listener_)
42 close_listener_->OnBalloonClosed(this);
43 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/balloon.h ('k') | chrome/browser/notifications/balloon_collection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698