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/browser_tab_strip_model_delegate.h" | 5 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sessions/tab_restore_service.h" | 10 #include "chrome/browser/sessions/tab_restore_service.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 int BrowserTabStripModelDelegate::GetDragActions() const { | 78 int BrowserTabStripModelDelegate::GetDragActions() const { |
79 return TabStripModelDelegate::TAB_TEAROFF_ACTION | | 79 return TabStripModelDelegate::TAB_TEAROFF_ACTION | |
80 (browser_->tab_count() > 1 ? TabStripModelDelegate::TAB_MOVE_ACTION : 0); | 80 (browser_->tab_count() > 1 ? TabStripModelDelegate::TAB_MOVE_ACTION : 0); |
81 } | 81 } |
82 | 82 |
83 TabContents* BrowserTabStripModelDelegate::CreateTabContentsForURL( | 83 TabContents* BrowserTabStripModelDelegate::CreateTabContentsForURL( |
84 const GURL& url, const content::Referrer& referrer, Profile* profile, | 84 const GURL& url, const content::Referrer& referrer, Profile* profile, |
85 content::PageTransition transition, bool defer_load, | 85 content::PageTransition transition, bool defer_load, |
86 content::SiteInstance* instance) const { | 86 content::SiteInstance* instance) const { |
87 TabContents* contents = TabContentsFactory(profile, instance, | 87 TabContents* contents = TabContentsFactory(profile, instance, |
88 MSG_ROUTING_NONE, GetActiveWebContents(browser_), NULL); | 88 MSG_ROUTING_NONE, GetActiveWebContents(browser_)); |
89 if (!defer_load) { | 89 if (!defer_load) { |
90 // Load the initial URL before adding the new tab contents to the tab strip | 90 // Load the initial URL before adding the new tab contents to the tab strip |
91 // so that the tab contents has navigation state. | 91 // so that the tab contents has navigation state. |
92 contents->web_contents()->GetController().LoadURL( | 92 contents->web_contents()->GetController().LoadURL( |
93 url, referrer, transition, std::string()); | 93 url, referrer, transition, std::string()); |
94 } | 94 } |
95 | 95 |
96 return contents; | 96 return contents; |
97 } | 97 } |
98 | 98 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 | 160 |
161 //////////////////////////////////////////////////////////////////////////////// | 161 //////////////////////////////////////////////////////////////////////////////// |
162 // BrowserTabStripModelDelegate, private: | 162 // BrowserTabStripModelDelegate, private: |
163 | 163 |
164 void BrowserTabStripModelDelegate::CloseFrame() { | 164 void BrowserTabStripModelDelegate::CloseFrame() { |
165 browser_->window()->Close(); | 165 browser_->window()->Close(); |
166 } | 166 } |
167 | 167 |
168 } // namespace chrome | 168 } // namespace chrome |
OLD | NEW |