| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 protected: | 42 protected: |
| 43 virtual ~Delegate() {} | 43 virtual ~Delegate() {} |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 BackgroundContents( | 46 BackgroundContents( |
| 47 content::SiteInstance* site_instance, | 47 content::SiteInstance* site_instance, |
| 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 ~BackgroundContents() override; |
| 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 void CloseContents(content::WebContents* source) override; |
| 59 virtual bool ShouldSuppressDialogs() override; | 59 bool ShouldSuppressDialogs() override; |
| 60 virtual void DidNavigateMainFramePostCommit( | 60 void DidNavigateMainFramePostCommit(content::WebContents* tab) override; |
| 61 content::WebContents* tab) override; | 61 void AddNewContents(content::WebContents* source, |
| 62 virtual void AddNewContents(content::WebContents* source, | 62 content::WebContents* new_contents, |
| 63 content::WebContents* new_contents, | 63 WindowOpenDisposition disposition, |
| 64 WindowOpenDisposition disposition, | 64 const gfx::Rect& initial_pos, |
| 65 const gfx::Rect& initial_pos, | 65 bool user_gesture, |
| 66 bool user_gesture, | 66 bool* was_blocked) override; |
| 67 bool* was_blocked) override; | 67 bool IsNeverVisible(content::WebContents* web_contents) override; |
| 68 virtual bool IsNeverVisible(content::WebContents* web_contents) override; | |
| 69 | 68 |
| 70 // content::WebContentsObserver implementation: | 69 // content::WebContentsObserver implementation: |
| 71 virtual void RenderProcessGone(base::TerminationStatus status) override; | 70 void RenderProcessGone(base::TerminationStatus status) override; |
| 72 | 71 |
| 73 // content::NotificationObserver | 72 // content::NotificationObserver |
| 74 virtual void Observe(int type, | 73 void Observe(int type, |
| 75 const content::NotificationSource& source, | 74 const content::NotificationSource& source, |
| 76 const content::NotificationDetails& details) override; | 75 const content::NotificationDetails& details) override; |
| 77 | 76 |
| 78 protected: | 77 protected: |
| 79 // Exposed for testing. | 78 // Exposed for testing. |
| 80 BackgroundContents(); | 79 BackgroundContents(); |
| 81 | 80 |
| 82 private: | 81 private: |
| 83 // The delegate for this BackgroundContents. | 82 // The delegate for this BackgroundContents. |
| 84 Delegate* delegate_; | 83 Delegate* delegate_; |
| 85 | 84 |
| 86 Profile* profile_; | 85 Profile* profile_; |
| 87 scoped_ptr<content::WebContents> web_contents_; | 86 scoped_ptr<content::WebContents> web_contents_; |
| 88 content::NotificationRegistrar registrar_; | 87 content::NotificationRegistrar registrar_; |
| 89 | 88 |
| 90 DISALLOW_COPY_AND_ASSIGN(BackgroundContents); | 89 DISALLOW_COPY_AND_ASSIGN(BackgroundContents); |
| 91 }; | 90 }; |
| 92 | 91 |
| 93 // This is the data sent out as the details with BACKGROUND_CONTENTS_OPENED. | 92 // This is the data sent out as the details with BACKGROUND_CONTENTS_OPENED. |
| 94 struct BackgroundContentsOpenedDetails { | 93 struct BackgroundContentsOpenedDetails { |
| 95 // The BackgroundContents object that has just been opened. | 94 // The BackgroundContents object that has just been opened. |
| 96 BackgroundContents* contents; | 95 BackgroundContents* contents; |
| 97 | 96 |
| 98 // The name of the parent frame for these contents. | 97 // The name of the parent frame for these contents. |
| 99 const base::string16& frame_name; | 98 const base::string16& frame_name; |
| 100 | 99 |
| 101 // The ID of the parent application (if any). | 100 // The ID of the parent application (if any). |
| 102 const base::string16& application_id; | 101 const base::string16& application_id; |
| 103 }; | 102 }; |
| 104 | 103 |
| 105 #endif // CHROME_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ | 104 #endif // CHROME_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ |
| OLD | NEW |