Home | History | Annotate | Download | only in notifications
      1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_UI_COCOA_NOTIFICATIONS_BALLOON_VIEW_BRIDGE_H_
      6 #define CHROME_BROWSER_UI_COCOA_NOTIFICATIONS_BALLOON_VIEW_BRIDGE_H_
      7 #pragma once
      8 
      9 #include "chrome/browser/notifications/balloon.h"
     10 
     11 @class BalloonController;
     12 class BalloonHost;
     13 namespace gfx {
     14 class Size;
     15 }
     16 
     17 // Bridges from the cross-platform BalloonView interface to the Cocoa
     18 // controller which will draw the view on screen.
     19 class BalloonViewBridge : public BalloonView {
     20  public:
     21   BalloonViewBridge();
     22   ~BalloonViewBridge();
     23 
     24   // BalloonView interface.
     25   virtual void Show(Balloon* balloon);
     26   virtual void Update();
     27   virtual void RepositionToBalloon();
     28   virtual void Close(bool by_user);
     29   virtual gfx::Size GetSize() const;
     30   virtual BalloonHost* GetHost() const;
     31 
     32  private:
     33   // Weak pointer to the balloon controller which manages the UI.
     34   // This object cleans itself up when its windows close.
     35   BalloonController* controller_;
     36 
     37   DISALLOW_COPY_AND_ASSIGN(BalloonViewBridge);
     38 };
     39 
     40 #endif  // CHROME_BROWSER_UI_COCOA_NOTIFICATIONS_BALLOON_VIEW_BRIDGE_H_
     41