Home | History | Annotate | Download | only in turndown_prompt
      1 // Copyright 2013 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_FRAME_TURNDOWN_PROMPT_TURNDOWN_PROMPT_CONTENT_H_
      6 #define CHROME_FRAME_TURNDOWN_PROMPT_TURNDOWN_PROMPT_CONTENT_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/callback.h"
     10 #include "base/memory/scoped_ptr.h"
     11 #include "base/memory/weak_ptr.h"
     12 #include "chrome_frame/infobars/infobar_content.h"
     13 
     14 class TurndownPromptWindow;
     15 class UrlLauncher;
     16 
     17 // Encapsulates the turndown prompt inviting users to learn about the turndown
     18 // of Chrome Frame.
     19 class TurndownPromptContent : public InfobarContent {
     20  public:
     21   // Takes ownership of the UrlLauncher instance, which will be freed upon
     22   // destruction of the TurndownPromptContent.
     23   TurndownPromptContent(UrlLauncher* url_launcher,
     24                         const base::Closure& uninstall_closure);
     25   virtual ~TurndownPromptContent();
     26 
     27   // InfobarContent implementation
     28   virtual bool InstallInFrame(Frame* frame);
     29   virtual void SetDimensions(const RECT& dimensions);
     30   virtual size_t GetDesiredSize(size_t width, size_t height);
     31 
     32  private:
     33   base::WeakPtr<TurndownPromptWindow> window_;
     34   scoped_ptr<UrlLauncher> url_launcher_;
     35   base::Closure uninstall_closure_;
     36 
     37   DISALLOW_COPY_AND_ASSIGN(TurndownPromptContent);
     38 };  // class TurndownPromptContent
     39 
     40 #endif  // CHROME_FRAME_TURNDOWN_PROMPT_TURNDOWN_PROMPT_CONTENT_H_
     41