| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 #include "chrome/common/chrome_switches.h" | 130 #include "chrome/common/chrome_switches.h" |
| 131 #include "chrome/common/custom_handlers/protocol_handler.h" | 131 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 132 #include "chrome/common/extensions/extension.h" | 132 #include "chrome/common/extensions/extension.h" |
| 133 #include "chrome/common/extensions/extension_constants.h" | 133 #include "chrome/common/extensions/extension_constants.h" |
| 134 #include "chrome/common/pref_names.h" | 134 #include "chrome/common/pref_names.h" |
| 135 #include "chrome/common/profiling.h" | 135 #include "chrome/common/profiling.h" |
| 136 #include "chrome/common/url_constants.h" | 136 #include "chrome/common/url_constants.h" |
| 137 #include "chrome/common/web_apps.h" | 137 #include "chrome/common/web_apps.h" |
| 138 #include "content/browser/browser_url_handler.h" | 138 #include "content/browser/browser_url_handler.h" |
| 139 #include "content/browser/child_process_security_policy.h" | 139 #include "content/browser/child_process_security_policy.h" |
| 140 #include "content/browser/debugger/devtools_manager.h" | |
| 141 #include "content/browser/download/download_item.h" | 140 #include "content/browser/download/download_item.h" |
| 142 #include "content/browser/download/download_manager.h" | 141 #include "content/browser/download/download_manager.h" |
| 143 #include "content/browser/download/save_package.h" | 142 #include "content/browser/download/save_package.h" |
| 144 #include "content/browser/host_zoom_map.h" | 143 #include "content/browser/host_zoom_map.h" |
| 145 #include "content/browser/plugin_service.h" | 144 #include "content/browser/plugin_service.h" |
| 146 #include "content/browser/renderer_host/render_view_host.h" | 145 #include "content/browser/renderer_host/render_view_host.h" |
| 147 #include "content/browser/site_instance.h" | 146 #include "content/browser/site_instance.h" |
| 148 #include "content/browser/tab_contents/interstitial_page.h" | 147 #include "content/browser/tab_contents/interstitial_page.h" |
| 149 #include "content/browser/tab_contents/navigation_controller.h" | 148 #include "content/browser/tab_contents/navigation_controller.h" |
| 150 #include "content/browser/tab_contents/navigation_entry.h" | 149 #include "content/browser/tab_contents/navigation_entry.h" |
| 151 #include "content/browser/tab_contents/tab_contents_view.h" | 150 #include "content/browser/tab_contents/tab_contents_view.h" |
| 152 #include "content/browser/user_metrics.h" | 151 #include "content/browser/user_metrics.h" |
| 152 #include "content/public/browser/devtools_manager.h" |
| 153 #include "content/public/browser/notification_service.h" | 153 #include "content/public/browser/notification_service.h" |
| 154 #include "content/public/browser/notification_details.h" | 154 #include "content/public/browser/notification_details.h" |
| 155 #include "content/public/common/content_restriction.h" | 155 #include "content/public/common/content_restriction.h" |
| 156 #include "content/public/common/content_switches.h" | 156 #include "content/public/common/content_switches.h" |
| 157 #include "content/public/common/page_zoom.h" | 157 #include "content/public/common/page_zoom.h" |
| 158 #include "grit/chromium_strings.h" | 158 #include "grit/chromium_strings.h" |
| 159 #include "grit/generated_resources.h" | 159 #include "grit/generated_resources.h" |
| 160 #include "grit/locale_settings.h" | 160 #include "grit/locale_settings.h" |
| 161 #include "grit/theme_resources_standard.h" | 161 #include "grit/theme_resources_standard.h" |
| 162 #include "net/base/cookie_monster.h" | 162 #include "net/base/cookie_monster.h" |
| (...skipping 3150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3313 | 3313 |
| 3314 SessionService* session_service = | 3314 SessionService* session_service = |
| 3315 SessionServiceFactory::GetForProfile(profile()); | 3315 SessionServiceFactory::GetForProfile(profile()); |
| 3316 if (session_service) { | 3316 if (session_service) { |
| 3317 // The new_contents may end up with a different navigation stack. Force | 3317 // The new_contents may end up with a different navigation stack. Force |
| 3318 // the session service to update itself. | 3318 // the session service to update itself. |
| 3319 session_service->TabRestored( | 3319 session_service->TabRestored( |
| 3320 new_contents, tab_handler_->GetTabStripModel()->IsTabPinned(index)); | 3320 new_contents, tab_handler_->GetTabStripModel()->IsTabPinned(index)); |
| 3321 } | 3321 } |
| 3322 | 3322 |
| 3323 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); | 3323 content::DevToolsManager::GetInstance()->TabReplaced( |
| 3324 if (devtools_manager) // NULL in unit tests. | 3324 old_contents->tab_contents(), new_contents->tab_contents()); |
| 3325 devtools_manager->TabReplaced(old_contents->tab_contents(), | |
| 3326 new_contents->tab_contents()); | |
| 3327 } | 3325 } |
| 3328 | 3326 |
| 3329 void Browser::TabPinnedStateChanged(TabContentsWrapper* contents, int index) { | 3327 void Browser::TabPinnedStateChanged(TabContentsWrapper* contents, int index) { |
| 3330 SessionService* session_service = | 3328 SessionService* session_service = |
| 3331 SessionServiceFactory::GetForProfileIfExisting(profile()); | 3329 SessionServiceFactory::GetForProfileIfExisting(profile()); |
| 3332 if (session_service) { | 3330 if (session_service) { |
| 3333 session_service->SetPinnedState( | 3331 session_service->SetPinnedState( |
| 3334 session_id(), | 3332 session_id(), |
| 3335 GetTabContentsWrapperAt(index)->restore_tab_helper()->session_id(), | 3333 GetTabContentsWrapperAt(index)->restore_tab_helper()->session_id(), |
| 3336 tab_handler_->GetTabStripModel()->IsTabPinned(index)); | 3334 tab_handler_->GetTabStripModel()->IsTabPinned(index)); |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4131 instant_unload_handler_.reset(); | 4129 instant_unload_handler_.reset(); |
| 4132 } | 4130 } |
| 4133 } else { | 4131 } else { |
| 4134 CreateInstantIfNecessary(); | 4132 CreateInstantIfNecessary(); |
| 4135 } | 4133 } |
| 4136 } else if (pref_name == prefs::kIncognitoModeAvailability) { | 4134 } else if (pref_name == prefs::kIncognitoModeAvailability) { |
| 4137 UpdateCommandsForIncognitoAvailability(); | 4135 UpdateCommandsForIncognitoAvailability(); |
| 4138 } else if (pref_name == prefs::kDevToolsDisabled) { | 4136 } else if (pref_name == prefs::kDevToolsDisabled) { |
| 4139 UpdateCommandsForDevTools(); | 4137 UpdateCommandsForDevTools(); |
| 4140 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) | 4138 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) |
| 4141 DevToolsManager::GetInstance()->CloseAllClientHosts(); | 4139 content::DevToolsManager::GetInstance()->CloseAllClientHosts(); |
| 4142 } else if (pref_name == prefs::kEditBookmarksEnabled) { | 4140 } else if (pref_name == prefs::kEditBookmarksEnabled) { |
| 4143 UpdateCommandsForBookmarkEditing(); | 4141 UpdateCommandsForBookmarkEditing(); |
| 4144 } else if (pref_name == prefs::kShowBookmarkBar) { | 4142 } else if (pref_name == prefs::kShowBookmarkBar) { |
| 4145 UpdateCommandsForBookmarkBar(); | 4143 UpdateCommandsForBookmarkBar(); |
| 4146 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE); | 4144 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE); |
| 4147 } else if (pref_name == prefs::kHomePage) { | 4145 } else if (pref_name == prefs::kHomePage) { |
| 4148 PrefService* pref_service = content::Source<PrefService>(source).ptr(); | 4146 PrefService* pref_service = content::Source<PrefService>(source).ptr(); |
| 4149 MarkHomePageAsChanged(pref_service); | 4147 MarkHomePageAsChanged(pref_service); |
| 4150 } else if (pref_name == prefs::kAllowFileSelectionDialogs) { | 4148 } else if (pref_name == prefs::kAllowFileSelectionDialogs) { |
| 4151 UpdateSaveAsState(GetContentRestrictionsForSelectedTab()); | 4149 UpdateSaveAsState(GetContentRestrictionsForSelectedTab()); |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5307 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5305 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
| 5308 } else { | 5306 } else { |
| 5309 GlobalErrorService* service = | 5307 GlobalErrorService* service = |
| 5310 GlobalErrorServiceFactory::GetForProfile(profile()); | 5308 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5311 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5309 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5312 if (error) { | 5310 if (error) { |
| 5313 error->ShowBubbleView(this); | 5311 error->ShowBubbleView(this); |
| 5314 } | 5312 } |
| 5315 } | 5313 } |
| 5316 } | 5314 } |
| OLD | NEW |