Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/sync/sessions/sessions_util.h" | 5 #include "chrome/browser/sync/sessions/sessions_util.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sync/glue/synced_tab_delegate.h" | 7 #include "chrome/browser/sync/glue/synced_tab_delegate.h" |
| 8 #include "chrome/browser/sync/glue/synced_window_delegate.h" | 8 #include "chrome/browser/sync/glue/synced_window_delegate.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "content/public/browser/navigation_entry.h" | 10 #include "content/public/browser/navigation_entry.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 const content::NavigationEntry* entry = (i == pending_index) ? | 32 const content::NavigationEntry* entry = (i == pending_index) ? |
| 33 tab.GetPendingEntry() : tab.GetEntryAtIndex(i); | 33 tab.GetPendingEntry() : tab.GetEntryAtIndex(i); |
| 34 if (!entry) | 34 if (!entry) |
| 35 return false; | 35 return false; |
| 36 const GURL& virtual_url = entry->GetVirtualURL(); | 36 const GURL& virtual_url = entry->GetVirtualURL(); |
| 37 if (virtual_url.is_valid() && | 37 if (virtual_url.is_valid() && |
| 38 !virtual_url.SchemeIs(content::kChromeUIScheme) && | 38 !virtual_url.SchemeIs(content::kChromeUIScheme) && |
| 39 !virtual_url.SchemeIs(chrome::kChromeNativeScheme) && | 39 !virtual_url.SchemeIs(chrome::kChromeNativeScheme) && |
| 40 !virtual_url.SchemeIsFile()) { | 40 !virtual_url.SchemeIsFile()) { |
| 41 found_valid_url = true; | 41 found_valid_url = true; |
| 42 } else if (virtual_url == GURL(chrome::kChromeUIHistoryURL)) { | |
| 43 // The history page is treated specially as we want it to trigger syncable | |
|
stanisc
2015/04/14 22:42:40
Wouldn't there be a race condition between the pag
Nicolas Zea
2015/04/16 17:30:30
Yes, but that's fine. Once we do model association
| |
| 44 // events for UI purposes. | |
| 45 found_valid_url = true; | |
|
stanisc
2015/04/14 22:42:40
Perhaps break the loop (here and above) once the v
Nicolas Zea
2015/04/16 17:30:29
We actually deliberately keep looping to ensure th
| |
| 42 } | 46 } |
| 43 } | 47 } |
| 44 return found_valid_url; | 48 return found_valid_url; |
| 45 } | 49 } |
| 46 | 50 |
| 47 } // namespace sessions_util | 51 } // namespace sessions_util |
| 48 | 52 |
| 49 } // namespace browser_sync | 53 } // namespace browser_sync |
| OLD | NEW |