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

Side by Side Diff: chrome/browser/ui/android/tab_model/tab_model_list.cc

Issue 23792002: Set the WindowId of the SessionTabHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/android/tab_model/tab_model_list.h" 5 #include "chrome/browser/ui/android/tab_model/tab_model_list.h"
6 6
7 #include "chrome/browser/android/tab_android.h" 7 #include "chrome/browser/android/tab_android.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/android/tab_model/tab_model.h" 9 #include "chrome/browser/ui/android/tab_model/tab_model.h"
10 #include "chrome/browser/ui/browser_navigator.h" 10 #include "chrome/browser/ui/browser_navigator.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 45
46 TabModel* TabModelList::GetTabModelWithProfile( 46 TabModel* TabModelList::GetTabModelWithProfile(
47 Profile* profile) { 47 Profile* profile) {
48 if (!profile) 48 if (!profile)
49 return NULL; 49 return NULL;
50 50
51 for (TabModelList::const_iterator i = TabModelList::begin(); 51 for (TabModelList::const_iterator i = TabModelList::begin();
52 i != TabModelList::end(); ++i) { 52 i != TabModelList::end(); ++i) {
53 if (profile->IsSameProfile((*i)->GetProfile())) 53 Profile* model_profile = (*i)->GetProfile();
54 if (profile->IsSameProfile(model_profile) &&
55 profile->IsOffTheRecord() == model_profile->IsOffTheRecord()) {
54 return *i; 56 return *i;
57 }
55 } 58 }
56 59
57 return NULL; 60 return NULL;
58 } 61 }
59 62
60 TabModel* TabModelList::FindTabModelWithId( 63 TabModel* TabModelList::FindTabModelWithId(
61 SessionID::id_type desired_id) { 64 SessionID::id_type desired_id) {
62 for (TabModelList::const_iterator i = TabModelList::begin(); 65 for (TabModelList::const_iterator i = TabModelList::begin();
63 i != TabModelList::end(); i++) { 66 i != TabModelList::end(); i++) {
64 if ((*i)->GetSessionId() == desired_id) 67 if ((*i)->GetSessionId() == desired_id)
(...skipping 21 matching lines...) Expand all
86 return tab_models().end(); 89 return tab_models().end();
87 } 90 }
88 91
89 bool TabModelList::empty() { 92 bool TabModelList::empty() {
90 return tab_models().empty(); 93 return tab_models().empty();
91 } 94 }
92 95
93 size_t TabModelList::size() { 96 size_t TabModelList::size() {
94 return tab_models().size(); 97 return tab_models().size();
95 } 98 }
OLDNEW
« chrome/browser/android/tab_android.cc ('K') | « chrome/browser/android/tab_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698