| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/tabs/tab_strip_model.h" | 5 #include "chrome/browser/tabs/tab_strip_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/stl_util-inl.h" |
| 9 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 10 #include "chrome/browser/metrics/user_metrics.h" | 11 #include "chrome/browser/metrics/user_metrics.h" |
| 11 #include "chrome/browser/profile.h" | 12 #include "chrome/browser/profile.h" |
| 12 #include "chrome/browser/sessions/tab_restore_service.h" | 13 #include "chrome/browser/sessions/tab_restore_service.h" |
| 13 #include "chrome/browser/tabs/tab_strip_model_order_controller.h" | 14 #include "chrome/browser/tabs/tab_strip_model_order_controller.h" |
| 14 #include "chrome/browser/tab_contents/navigation_controller.h" | 15 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 15 #include "chrome/browser/tab_contents/tab_contents.h" | 16 #include "chrome/browser/tab_contents/tab_contents.h" |
| 16 #include "chrome/common/notification_service.h" | 17 #include "chrome/common/notification_service.h" |
| 17 #include "chrome/common/stl_util-inl.h" | |
| 18 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // Returns true if the specified transition is one of the types that cause the | 22 // Returns true if the specified transition is one of the types that cause the |
| 23 // opener relationships for the tab in which the transition occured to be | 23 // opener relationships for the tab in which the transition occured to be |
| 24 // forgotten. This is generally any navigation that isn't a link click (i.e. | 24 // forgotten. This is generally any navigation that isn't a link click (i.e. |
| 25 // any navigation that can be considered to be the start of a new task distinct | 25 // any navigation that can be considered to be the start of a new task distinct |
| 26 // from what had previously occurred in that tab). | 26 // from what had previously occurred in that tab). |
| 27 bool ShouldForgetOpenersForTransition(PageTransition::Type transition) { | 27 bool ShouldForgetOpenersForTransition(PageTransition::Type transition) { |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 int index = GetIndexOfTabContents(contents); | 568 int index = GetIndexOfTabContents(contents); |
| 569 contents_data_.at(index)->opener = &opener->controller(); | 569 contents_data_.at(index)->opener = &opener->controller(); |
| 570 } | 570 } |
| 571 | 571 |
| 572 // static | 572 // static |
| 573 bool TabStripModel::OpenerMatches(const TabContentsData* data, | 573 bool TabStripModel::OpenerMatches(const TabContentsData* data, |
| 574 const NavigationController* opener, | 574 const NavigationController* opener, |
| 575 bool use_group) { | 575 bool use_group) { |
| 576 return data->opener == opener || (use_group && data->group == opener); | 576 return data->opener == opener || (use_group && data->group == opener); |
| 577 } | 577 } |
| OLD | NEW |