| 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/browser_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 // WebContents is invisible and won't size it. | 609 // WebContents is invisible and won't size it. |
| 610 browser->window()->Show(); | 610 browser->window()->Show(); |
| 611 | 611 |
| 612 // The page transition below is only for the purpose of inserting the tab. | 612 // The page transition below is only for the purpose of inserting the tab. |
| 613 AddTab(browser, contents_dupe, content::PAGE_TRANSITION_LINK); | 613 AddTab(browser, contents_dupe, content::PAGE_TRANSITION_LINK); |
| 614 } | 614 } |
| 615 | 615 |
| 616 SessionService* session_service = | 616 SessionService* session_service = |
| 617 SessionServiceFactory::GetForProfileIfExisting(browser->profile()); | 617 SessionServiceFactory::GetForProfileIfExisting(browser->profile()); |
| 618 if (session_service) | 618 if (session_service) |
| 619 session_service->TabRestored(contents_dupe, pinned); | 619 session_service->TabRestored(contents_dupe->web_contents(), pinned); |
| 620 return contents_dupe; | 620 return contents_dupe; |
| 621 } | 621 } |
| 622 | 622 |
| 623 bool CanDuplicateTabAt(Browser* browser, int index) { | 623 bool CanDuplicateTabAt(Browser* browser, int index) { |
| 624 content::NavigationController& nc = | 624 content::NavigationController& nc = |
| 625 GetWebContentsAt(browser, index)->GetController(); | 625 GetWebContentsAt(browser, index)->GetController(); |
| 626 return nc.GetWebContents() && nc.GetLastCommittedEntry(); | 626 return nc.GetWebContents() && nc.GetLastCommittedEntry(); |
| 627 } | 627 } |
| 628 | 628 |
| 629 void ConvertPopupToTabbedBrowser(Browser* browser) { | 629 void ConvertPopupToTabbedBrowser(Browser* browser) { |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 // WebContents is invisible and won't size it. | 1041 // WebContents is invisible and won't size it. |
| 1042 b->window()->Show(); | 1042 b->window()->Show(); |
| 1043 | 1043 |
| 1044 // The page transition below is only for the purpose of inserting the tab. | 1044 // The page transition below is only for the purpose of inserting the tab. |
| 1045 AddTab(b, view_source_contents, content::PAGE_TRANSITION_LINK); | 1045 AddTab(b, view_source_contents, content::PAGE_TRANSITION_LINK); |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 SessionService* session_service = | 1048 SessionService* session_service = |
| 1049 SessionServiceFactory::GetForProfileIfExisting(browser->profile()); | 1049 SessionServiceFactory::GetForProfileIfExisting(browser->profile()); |
| 1050 if (session_service) | 1050 if (session_service) |
| 1051 session_service->TabRestored(view_source_contents, false); | 1051 session_service->TabRestored(view_source_contents->web_contents(), false); |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 void ViewSelectedSource(Browser* browser) { | 1054 void ViewSelectedSource(Browser* browser) { |
| 1055 ViewSource(browser, GetActiveTabContents(browser)); | 1055 ViewSource(browser, GetActiveTabContents(browser)); |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 bool CanViewSource(const Browser* browser) { | 1058 bool CanViewSource(const Browser* browser) { |
| 1059 return GetActiveWebContents(browser)->GetController().CanViewSource(); | 1059 return GetActiveWebContents(browser)->GetController().CanViewSource(); |
| 1060 } | 1060 } |
| 1061 | 1061 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1088 BrowserCommandsTabContentsCreator::CreateTabContents(contents); | 1088 BrowserCommandsTabContentsCreator::CreateTabContents(contents); |
| 1089 } | 1089 } |
| 1090 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); | 1090 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); |
| 1091 | 1091 |
| 1092 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1092 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1093 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1093 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1094 app_browser->window()->Show(); | 1094 app_browser->window()->Show(); |
| 1095 } | 1095 } |
| 1096 | 1096 |
| 1097 } // namespace chrome | 1097 } // namespace chrome |
| OLD | NEW |