| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ | 
| 6 #define CHROME_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 | 9 | 
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 48       int routing_id, | 48       int routing_id, | 
| 49       Delegate* delegate, | 49       Delegate* delegate, | 
| 50       const std::string& partition_id, | 50       const std::string& partition_id, | 
| 51       content::SessionStorageNamespace* session_storage_namespace); | 51       content::SessionStorageNamespace* session_storage_namespace); | 
| 52   virtual ~BackgroundContents(); | 52   virtual ~BackgroundContents(); | 
| 53 | 53 | 
| 54   content::WebContents* web_contents() const { return web_contents_.get(); } | 54   content::WebContents* web_contents() const { return web_contents_.get(); } | 
| 55   virtual const GURL& GetURL() const; | 55   virtual const GURL& GetURL() const; | 
| 56 | 56 | 
| 57   // content::WebContentsDelegate implementation: | 57   // content::WebContentsDelegate implementation: | 
| 58   virtual void CloseContents(content::WebContents* source) OVERRIDE; | 58   virtual void CloseContents(content::WebContents* source) override; | 
| 59   virtual bool ShouldSuppressDialogs() OVERRIDE; | 59   virtual bool ShouldSuppressDialogs() override; | 
| 60   virtual void DidNavigateMainFramePostCommit( | 60   virtual void DidNavigateMainFramePostCommit( | 
| 61       content::WebContents* tab) OVERRIDE; | 61       content::WebContents* tab) override; | 
| 62   virtual void AddNewContents(content::WebContents* source, | 62   virtual void AddNewContents(content::WebContents* source, | 
| 63                               content::WebContents* new_contents, | 63                               content::WebContents* new_contents, | 
| 64                               WindowOpenDisposition disposition, | 64                               WindowOpenDisposition disposition, | 
| 65                               const gfx::Rect& initial_pos, | 65                               const gfx::Rect& initial_pos, | 
| 66                               bool user_gesture, | 66                               bool user_gesture, | 
| 67                               bool* was_blocked) OVERRIDE; | 67                               bool* was_blocked) override; | 
| 68   virtual bool IsNeverVisible(content::WebContents* web_contents) OVERRIDE; | 68   virtual bool IsNeverVisible(content::WebContents* web_contents) override; | 
| 69 | 69 | 
| 70   // content::WebContentsObserver implementation: | 70   // content::WebContentsObserver implementation: | 
| 71   virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 71   virtual void RenderProcessGone(base::TerminationStatus status) override; | 
| 72 | 72 | 
| 73   // content::NotificationObserver | 73   // content::NotificationObserver | 
| 74   virtual void Observe(int type, | 74   virtual void Observe(int type, | 
| 75                        const content::NotificationSource& source, | 75                        const content::NotificationSource& source, | 
| 76                        const content::NotificationDetails& details) OVERRIDE; | 76                        const content::NotificationDetails& details) override; | 
| 77 | 77 | 
| 78  protected: | 78  protected: | 
| 79   // Exposed for testing. | 79   // Exposed for testing. | 
| 80   BackgroundContents(); | 80   BackgroundContents(); | 
| 81 | 81 | 
| 82  private: | 82  private: | 
| 83   // The delegate for this BackgroundContents. | 83   // The delegate for this BackgroundContents. | 
| 84   Delegate* delegate_; | 84   Delegate* delegate_; | 
| 85 | 85 | 
| 86   Profile* profile_; | 86   Profile* profile_; | 
| 87   scoped_ptr<content::WebContents> web_contents_; | 87   scoped_ptr<content::WebContents> web_contents_; | 
| 88   content::NotificationRegistrar registrar_; | 88   content::NotificationRegistrar registrar_; | 
| 89 | 89 | 
| 90   DISALLOW_COPY_AND_ASSIGN(BackgroundContents); | 90   DISALLOW_COPY_AND_ASSIGN(BackgroundContents); | 
| 91 }; | 91 }; | 
| 92 | 92 | 
| 93 // This is the data sent out as the details with BACKGROUND_CONTENTS_OPENED. | 93 // This is the data sent out as the details with BACKGROUND_CONTENTS_OPENED. | 
| 94 struct BackgroundContentsOpenedDetails { | 94 struct BackgroundContentsOpenedDetails { | 
| 95   // The BackgroundContents object that has just been opened. | 95   // The BackgroundContents object that has just been opened. | 
| 96   BackgroundContents* contents; | 96   BackgroundContents* contents; | 
| 97 | 97 | 
| 98   // The name of the parent frame for these contents. | 98   // The name of the parent frame for these contents. | 
| 99   const base::string16& frame_name; | 99   const base::string16& frame_name; | 
| 100 | 100 | 
| 101   // The ID of the parent application (if any). | 101   // The ID of the parent application (if any). | 
| 102   const base::string16& application_id; | 102   const base::string16& application_id; | 
| 103 }; | 103 }; | 
| 104 | 104 | 
| 105 #endif  // CHROME_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ | 105 #endif  // CHROME_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ | 
| OLD | NEW | 
|---|