OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "chrome/browser/autofill/autocomplete_history_manager.h" | 9 #include "chrome/browser/autofill/autocomplete_history_manager.h" |
10 #include "chrome/browser/autofill/autofill_external_delegate.h" | 10 #include "chrome/browser/autofill/autofill_external_delegate.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 private: | 76 private: |
77 TabContents* tab_contents_; // unowned | 77 TabContents* tab_contents_; // unowned |
78 }; | 78 }; |
79 | 79 |
80 } // namespace | 80 } // namespace |
81 | 81 |
82 //////////////////////////////////////////////////////////////////////////////// | 82 //////////////////////////////////////////////////////////////////////////////// |
83 // TabContents, public: | 83 // TabContents, public: |
84 | 84 |
| 85 // static |
| 86 TabContents* TabContents::Factory::CreateTabContents(WebContents* contents) { |
| 87 return new TabContents(contents); |
| 88 } |
| 89 |
| 90 // static |
| 91 TabContents* TabContents::Factory::CloneTabContents(TabContents* contents) { |
| 92 return contents->Clone(); |
| 93 } |
| 94 |
85 TabContents::TabContents(WebContents* contents) | 95 TabContents::TabContents(WebContents* contents) |
86 : content::WebContentsObserver(contents), | 96 : content::WebContentsObserver(contents), |
87 in_destructor_(false), | 97 in_destructor_(false), |
88 web_contents_(contents) { | 98 web_contents_(contents) { |
89 DCHECK(contents); | 99 DCHECK(contents); |
90 DCHECK(!FromWebContents(contents)); | 100 DCHECK(!FromWebContents(contents)); |
91 | 101 |
92 chrome::SetViewType(contents, chrome::VIEW_TYPE_TAB_CONTENTS); | 102 chrome::SetViewType(contents, chrome::VIEW_TYPE_TAB_CONTENTS); |
93 | 103 |
94 // Stash this in the WebContents. | 104 // Stash this in the WebContents. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 #if defined(ENABLE_SESSION_SERVICE) | 274 #if defined(ENABLE_SESSION_SERVICE) |
265 SessionService* session = | 275 SessionService* session = |
266 SessionServiceFactory::GetForProfile(profile()); | 276 SessionServiceFactory::GetForProfile(profile()); |
267 if (session) { | 277 if (session) { |
268 session->SetTabUserAgentOverride(restore_tab_helper()->window_id(), | 278 session->SetTabUserAgentOverride(restore_tab_helper()->window_id(), |
269 restore_tab_helper()->session_id(), | 279 restore_tab_helper()->session_id(), |
270 user_agent); | 280 user_agent); |
271 } | 281 } |
272 #endif | 282 #endif |
273 } | 283 } |
OLD | NEW |