Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: chrome/browser/ui/browser_tab_strip_model_delegate.cc

Issue 149393004: Revert of Unify desktop and Android tab helper instantiation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_tab_contents.cc ('k') | chrome/browser/ui/tab_helpers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/sessions/tab_restore_service.h" 11 #include "chrome/browser/sessions/tab_restore_service.h"
12 #include "chrome/browser/sessions/tab_restore_service_factory.h" 12 #include "chrome/browser/sessions/tab_restore_service_factory.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_commands.h" 14 #include "chrome/browser/ui/browser_commands.h"
15 #include "chrome/browser/ui/browser_navigator.h" 15 #include "chrome/browser/ui/browser_navigator.h"
16 #include "chrome/browser/ui/browser_tab_contents.h"
16 #include "chrome/browser/ui/browser_tabstrip.h" 17 #include "chrome/browser/ui/browser_tabstrip.h"
17 #include "chrome/browser/ui/browser_window.h" 18 #include "chrome/browser/ui/browser_window.h"
18 #include "chrome/browser/ui/fast_unload_controller.h" 19 #include "chrome/browser/ui/fast_unload_controller.h"
19 #include "chrome/browser/ui/tab_helpers.h"
20 #include "chrome/browser/ui/tabs/dock_info.h" 20 #include "chrome/browser/ui/tabs/dock_info.h"
21 #include "chrome/browser/ui/tabs/tab_strip_model.h" 21 #include "chrome/browser/ui/tabs/tab_strip_model.h"
22 #include "chrome/browser/ui/unload_controller.h" 22 #include "chrome/browser/ui/unload_controller.h"
23 #include "chrome/common/chrome_switches.h" 23 #include "chrome/common/chrome_switches.h"
24 #include "content/public/browser/site_instance.h" 24 #include "content/public/browser/site_instance.h"
25 #include "content/public/browser/web_contents.h" 25 #include "content/public/browser/web_contents.h"
26 #include "content/public/browser/web_contents_delegate.h" 26 #include "content/public/browser/web_contents_delegate.h"
27 #include "content/public/common/page_transition_types.h" 27 #include "content/public/common/page_transition_types.h"
28 #include "ipc/ipc_message.h" 28 #include "ipc/ipc_message.h"
29 29
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // TODO(beng): find a better way of doing this. 84 // TODO(beng): find a better way of doing this.
85 static_cast<content::WebContentsDelegate*>(browser)-> 85 static_cast<content::WebContentsDelegate*>(browser)->
86 LoadingStateChanged(item.web_contents); 86 LoadingStateChanged(item.web_contents);
87 } 87 }
88 88
89 return browser; 89 return browser;
90 } 90 }
91 91
92 void BrowserTabStripModelDelegate::WillAddWebContents( 92 void BrowserTabStripModelDelegate::WillAddWebContents(
93 content::WebContents* contents) { 93 content::WebContents* contents) {
94 TabHelpers::AttachTabHelpers(contents); 94 BrowserTabContents::AttachTabHelpers(contents);
95 } 95 }
96 96
97 int BrowserTabStripModelDelegate::GetDragActions() const { 97 int BrowserTabStripModelDelegate::GetDragActions() const {
98 return TabStripModelDelegate::TAB_TEAROFF_ACTION | 98 return TabStripModelDelegate::TAB_TEAROFF_ACTION |
99 (browser_->tab_strip_model()->count() > 1 99 (browser_->tab_strip_model()->count() > 1
100 ? TabStripModelDelegate::TAB_MOVE_ACTION : 0); 100 ? TabStripModelDelegate::TAB_MOVE_ACTION : 0);
101 } 101 }
102 102
103 bool BrowserTabStripModelDelegate::CanDuplicateContentsAt(int index) { 103 bool BrowserTabStripModelDelegate::CanDuplicateContentsAt(int index) {
104 return CanDuplicateTabAt(browser_, index); 104 return CanDuplicateTabAt(browser_, index);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 174 }
175 175
176 //////////////////////////////////////////////////////////////////////////////// 176 ////////////////////////////////////////////////////////////////////////////////
177 // BrowserTabStripModelDelegate, private: 177 // BrowserTabStripModelDelegate, private:
178 178
179 void BrowserTabStripModelDelegate::CloseFrame() { 179 void BrowserTabStripModelDelegate::CloseFrame() {
180 browser_->window()->Close(); 180 browser_->window()->Close();
181 } 181 }
182 182
183 } // namespace chrome 183 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_tab_contents.cc ('k') | chrome/browser/ui/tab_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698