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

Side by Side Diff: chrome/browser/ui/sync/browser_synced_window_delegate.cc

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
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/sync/browser_synced_window_delegate.h" 5 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "chrome/browser/sessions/session_id.h" 9 #include "chrome/browser/sessions/session_id.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/browser_finder.h" 11 #include "chrome/browser/ui/browser_finder.h"
12 #include "chrome/browser/ui/browser_list.h" 12 #include "chrome/browser/ui/browser_list.h"
13 #include "chrome/browser/ui/browser_tabstrip.h"
13 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" 14 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h"
14 #include "chrome/browser/ui/tab_contents/tab_contents.h" 15 #include "chrome/browser/ui/tab_contents/tab_contents.h"
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" 16 #include "chrome/browser/ui/tabs/tab_strip_model.h"
16 17
17 // static SyncedWindowDelegate implementations 18 // static SyncedWindowDelegate implementations
18 19
19 // static 20 // static
20 const std::set<browser_sync::SyncedWindowDelegate*> 21 const std::set<browser_sync::SyncedWindowDelegate*>
21 browser_sync::SyncedWindowDelegate::GetSyncedWindowDelegates() { 22 browser_sync::SyncedWindowDelegate::GetSyncedWindowDelegates() {
22 std::set<browser_sync::SyncedWindowDelegate*> synced_window_delegates; 23 std::set<browser_sync::SyncedWindowDelegate*> synced_window_delegates;
(...skipping 17 matching lines...) Expand all
40 41
41 BrowserSyncedWindowDelegate::BrowserSyncedWindowDelegate(Browser* browser) 42 BrowserSyncedWindowDelegate::BrowserSyncedWindowDelegate(Browser* browser)
42 : browser_(browser) {} 43 : browser_(browser) {}
43 44
44 BrowserSyncedWindowDelegate::~BrowserSyncedWindowDelegate() {} 45 BrowserSyncedWindowDelegate::~BrowserSyncedWindowDelegate() {}
45 46
46 bool BrowserSyncedWindowDelegate::IsTabPinned( 47 bool BrowserSyncedWindowDelegate::IsTabPinned(
47 const browser_sync::SyncedTabDelegate* tab) const { 48 const browser_sync::SyncedTabDelegate* tab) const {
48 for (int i = 0; i < browser_->tab_count(); i++) { 49 for (int i = 0; i < browser_->tab_count(); i++) {
49 browser_sync::SyncedTabDelegate* current = 50 browser_sync::SyncedTabDelegate* current =
50 browser_->GetTabContentsAt(i)->synced_tab_delegate(); 51 chrome::GetTabContentsAt(browser_, i)->synced_tab_delegate();
51 if (tab == current) 52 if (tab == current)
52 return browser_->IsTabPinned(i); 53 return browser_->tab_strip_model()->IsTabPinned(i);
53 } 54 }
54 NOTREACHED(); 55 NOTREACHED();
55 return false; 56 return false;
56 } 57 }
57 58
58 browser_sync::SyncedTabDelegate* BrowserSyncedWindowDelegate::GetTabAt( 59 browser_sync::SyncedTabDelegate* BrowserSyncedWindowDelegate::GetTabAt(
59 int index) const { 60 int index) const {
60 return browser_->GetTabContentsAt(index)->synced_tab_delegate(); 61 return chrome::GetTabContentsAt(browser_, index)->synced_tab_delegate();
61 } 62 }
62 63
63 SessionID::id_type BrowserSyncedWindowDelegate::GetTabIdAt(int index) const { 64 SessionID::id_type BrowserSyncedWindowDelegate::GetTabIdAt(int index) const {
64 return GetTabAt(index)->GetSessionId(); 65 return GetTabAt(index)->GetSessionId();
65 } 66 }
66 67
67 bool BrowserSyncedWindowDelegate::HasWindow() const { 68 bool BrowserSyncedWindowDelegate::HasWindow() const {
68 return browser_->window() != NULL; 69 return browser_->window() != NULL;
69 } 70 }
70 71
(...skipping 17 matching lines...) Expand all
88 return browser_->is_type_tabbed(); 89 return browser_->is_type_tabbed();
89 } 90 }
90 91
91 bool BrowserSyncedWindowDelegate::IsTypePopup() const { 92 bool BrowserSyncedWindowDelegate::IsTypePopup() const {
92 return browser_->is_type_popup(); 93 return browser_->is_type_popup();
93 } 94 }
94 95
95 bool BrowserSyncedWindowDelegate::IsSessionRestoreInProgress() const { 96 bool BrowserSyncedWindowDelegate::IsSessionRestoreInProgress() const {
96 return false; 97 return false;
97 } 98 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_impl.cc ('k') | chrome/browser/ui/tab_contents/tab_contents_iterator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698