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

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

Issue 81193003: [Sync] Don't DCHECK if we can't find the window for a tab (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « no previous file | no next file » | 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/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"
(...skipping 29 matching lines...) Expand all
40 40
41 BrowserSyncedWindowDelegate::~BrowserSyncedWindowDelegate() {} 41 BrowserSyncedWindowDelegate::~BrowserSyncedWindowDelegate() {}
42 42
43 bool BrowserSyncedWindowDelegate::IsTabPinned( 43 bool BrowserSyncedWindowDelegate::IsTabPinned(
44 const browser_sync::SyncedTabDelegate* tab) const { 44 const browser_sync::SyncedTabDelegate* tab) const {
45 for (int i = 0; i < browser_->tab_strip_model()->count(); i++) { 45 for (int i = 0; i < browser_->tab_strip_model()->count(); i++) {
46 browser_sync::SyncedTabDelegate* current = GetTabAt(i); 46 browser_sync::SyncedTabDelegate* current = GetTabAt(i);
47 if (tab == current) 47 if (tab == current)
48 return browser_->tab_strip_model()->IsTabPinned(i); 48 return browser_->tab_strip_model()->IsTabPinned(i);
49 } 49 }
50 NOTREACHED(); 50 // The window and tab are not always updated atomically, so it's possible
51 // one of the values was stale. We'll retry later, just ignore for now.
51 return false; 52 return false;
52 } 53 }
53 54
54 browser_sync::SyncedTabDelegate* BrowserSyncedWindowDelegate::GetTabAt( 55 browser_sync::SyncedTabDelegate* BrowserSyncedWindowDelegate::GetTabAt(
55 int index) const { 56 int index) const {
56 return TabContentsSyncedTabDelegate::FromWebContents( 57 return TabContentsSyncedTabDelegate::FromWebContents(
57 browser_->tab_strip_model()->GetWebContentsAt(index)); 58 browser_->tab_strip_model()->GetWebContentsAt(index));
58 } 59 }
59 60
60 SessionID::id_type BrowserSyncedWindowDelegate::GetTabIdAt(int index) const { 61 SessionID::id_type BrowserSyncedWindowDelegate::GetTabIdAt(int index) const {
(...skipping 24 matching lines...) Expand all
85 return browser_->is_type_tabbed(); 86 return browser_->is_type_tabbed();
86 } 87 }
87 88
88 bool BrowserSyncedWindowDelegate::IsTypePopup() const { 89 bool BrowserSyncedWindowDelegate::IsTypePopup() const {
89 return browser_->is_type_popup(); 90 return browser_->is_type_popup();
90 } 91 }
91 92
92 bool BrowserSyncedWindowDelegate::IsSessionRestoreInProgress() const { 93 bool BrowserSyncedWindowDelegate::IsSessionRestoreInProgress() const {
93 return false; 94 return false;
94 } 95 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698