| 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/android/tab_model/tab_model.h" | 5 #include "chrome/browser/ui/android/tab_model/tab_model.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 content::WebContents* TabModel::GetActiveWebContents() const { | 75 content::WebContents* TabModel::GetActiveWebContents() const { |
| 76 int active_index = GetActiveIndex(); | 76 int active_index = GetActiveIndex(); |
| 77 if (active_index == INVALID_TAB_INDEX) | 77 if (active_index == INVALID_TAB_INDEX) |
| 78 return nullptr; | 78 return nullptr; |
| 79 return GetWebContentsAt(active_index); | 79 return GetWebContentsAt(active_index); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void TabModel::BroadcastSessionRestoreComplete() { | 82 void TabModel::BroadcastSessionRestoreComplete() { |
| 83 if (profile_) { | 83 if (profile_) { |
| 84 ProfileSyncService* sync_service = | 84 browser_sync::ProfileSyncService* sync_service = |
| 85 ProfileSyncServiceFactory::GetForProfile(profile_); | 85 ProfileSyncServiceFactory::GetForProfile(profile_); |
| 86 if (sync_service) | 86 if (sync_service) |
| 87 sync_service->OnSessionRestoreComplete(); | 87 sync_service->OnSessionRestoreComplete(); |
| 88 } else { | 88 } else { |
| 89 // TODO(nyquist): Uncomment this once downstream Android uses new | 89 // TODO(nyquist): Uncomment this once downstream Android uses new |
| 90 // constructor that takes a Profile* argument. See crbug.com/159704. | 90 // constructor that takes a Profile* argument. See crbug.com/159704. |
| 91 // NOTREACHED(); | 91 // NOTREACHED(); |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 109 if (is_off_the_record_) { | 109 if (is_off_the_record_) { |
| 110 Profile* profile = content::Source<Profile>(source).ptr(); | 110 Profile* profile = content::Source<Profile>(source).ptr(); |
| 111 if (profile && profile->IsOffTheRecord()) | 111 if (profile && profile->IsOffTheRecord()) |
| 112 profile_ = profile; | 112 profile_ = profile; |
| 113 } | 113 } |
| 114 break; | 114 break; |
| 115 default: | 115 default: |
| 116 NOTREACHED(); | 116 NOTREACHED(); |
| 117 } | 117 } |
| 118 } | 118 } |
| OLD | NEW |