OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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.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 // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 129 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
130 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 130 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
131 #include "chrome/browser/ui/tabs/tab_strip_model_utils.h" | 131 #include "chrome/browser/ui/tabs/tab_strip_model_utils.h" |
132 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" | 132 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" |
133 #include "chrome/browser/ui/unload_controller.h" | 133 #include "chrome/browser/ui/unload_controller.h" |
134 #include "chrome/browser/ui/validation_message_bubble.h" | 134 #include "chrome/browser/ui/validation_message_bubble.h" |
135 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 135 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
136 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 136 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
137 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 137 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
138 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 138 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
139 #include "chrome/browser/ui/zoom/zoom_controller.h" | |
140 #include "chrome/browser/upgrade_detector.h" | 139 #include "chrome/browser/upgrade_detector.h" |
141 #include "chrome/browser/web_applications/web_app.h" | 140 #include "chrome/browser/web_applications/web_app.h" |
142 #include "chrome/common/chrome_constants.h" | 141 #include "chrome/common/chrome_constants.h" |
143 #include "chrome/common/chrome_switches.h" | 142 #include "chrome/common/chrome_switches.h" |
144 #include "chrome/common/custom_handlers/protocol_handler.h" | 143 #include "chrome/common/custom_handlers/protocol_handler.h" |
145 #include "chrome/common/pref_names.h" | 144 #include "chrome/common/pref_names.h" |
146 #include "chrome/common/profiling.h" | 145 #include "chrome/common/profiling.h" |
147 #include "chrome/common/search_types.h" | 146 #include "chrome/common/search_types.h" |
148 #include "chrome/common/url_constants.h" | 147 #include "chrome/common/url_constants.h" |
149 #include "chrome/grit/chromium_strings.h" | 148 #include "chrome/grit/chromium_strings.h" |
150 #include "chrome/grit/generated_resources.h" | 149 #include "chrome/grit/generated_resources.h" |
151 #include "chrome/grit/locale_settings.h" | 150 #include "chrome/grit/locale_settings.h" |
152 #include "components/app_modal/javascript_dialog_manager.h" | 151 #include "components/app_modal/javascript_dialog_manager.h" |
153 #include "components/bookmarks/browser/bookmark_model.h" | 152 #include "components/bookmarks/browser/bookmark_model.h" |
154 #include "components/bookmarks/browser/bookmark_utils.h" | 153 #include "components/bookmarks/browser/bookmark_utils.h" |
155 #include "components/content_settings/core/browser/host_content_settings_map.h" | 154 #include "components/content_settings/core/browser/host_content_settings_map.h" |
156 #include "components/google/core/browser/google_url_tracker.h" | 155 #include "components/google/core/browser/google_url_tracker.h" |
157 #include "components/search/search.h" | 156 #include "components/search/search.h" |
158 #include "components/sessions/session_types.h" | 157 #include "components/sessions/session_types.h" |
159 #include "components/startup_metric_utils/startup_metric_utils.h" | 158 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 159 #include "components/ui/zoom/zoom_controller.h" |
160 #include "components/web_modal/popup_manager.h" | 160 #include "components/web_modal/popup_manager.h" |
161 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 161 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
162 #include "content/public/browser/devtools_agent_host.h" | 162 #include "content/public/browser/devtools_agent_host.h" |
163 #include "content/public/browser/download_item.h" | 163 #include "content/public/browser/download_item.h" |
164 #include "content/public/browser/download_manager.h" | 164 #include "content/public/browser/download_manager.h" |
165 #include "content/public/browser/interstitial_page.h" | 165 #include "content/public/browser/interstitial_page.h" |
166 #include "content/public/browser/invalidate_type.h" | 166 #include "content/public/browser/invalidate_type.h" |
167 #include "content/public/browser/navigation_controller.h" | 167 #include "content/public/browser/navigation_controller.h" |
168 #include "content/public/browser/navigation_entry.h" | 168 #include "content/public/browser/navigation_entry.h" |
169 #include "content/public/browser/notification_details.h" | 169 #include "content/public/browser/notification_details.h" |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1901 | 1901 |
1902 void Browser::URLStarredChanged(content::WebContents* web_contents, | 1902 void Browser::URLStarredChanged(content::WebContents* web_contents, |
1903 bool starred) { | 1903 bool starred) { |
1904 if (web_contents == tab_strip_model_->GetActiveWebContents()) | 1904 if (web_contents == tab_strip_model_->GetActiveWebContents()) |
1905 window_->SetStarredState(starred); | 1905 window_->SetStarredState(starred); |
1906 } | 1906 } |
1907 | 1907 |
1908 /////////////////////////////////////////////////////////////////////////////// | 1908 /////////////////////////////////////////////////////////////////////////////// |
1909 // Browser, ZoomObserver implementation: | 1909 // Browser, ZoomObserver implementation: |
1910 | 1910 |
1911 void Browser::OnZoomChanged(const ZoomController::ZoomChangedEventData& data) { | 1911 void Browser::OnZoomChanged( |
| 1912 const ui_zoom::ZoomController::ZoomChangedEventData& data) { |
1912 if (data.web_contents == tab_strip_model_->GetActiveWebContents()) { | 1913 if (data.web_contents == tab_strip_model_->GetActiveWebContents()) { |
1913 // Only show the zoom bubble for zoom changes in the active window. | 1914 // Only show the zoom bubble for zoom changes in the active window. |
1914 window_->ZoomChangedForActiveTab(data.can_show_bubble && | 1915 window_->ZoomChangedForActiveTab(data.can_show_bubble && |
1915 window_->IsActive()); | 1916 window_->IsActive()); |
1916 // Change the zoom commands state based on the zoom state | 1917 // Change the zoom commands state based on the zoom state |
1917 command_controller_->ZoomStateChanged(); | 1918 command_controller_->ZoomStateChanged(); |
1918 } | 1919 } |
1919 } | 1920 } |
1920 | 1921 |
1921 /////////////////////////////////////////////////////////////////////////////// | 1922 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2269 // ...and all the helpers. | 2270 // ...and all the helpers. |
2270 BookmarkTabHelper::FromWebContents(web_contents)->set_delegate(delegate); | 2271 BookmarkTabHelper::FromWebContents(web_contents)->set_delegate(delegate); |
2271 WebContentsModalDialogManager::FromWebContents(web_contents)-> | 2272 WebContentsModalDialogManager::FromWebContents(web_contents)-> |
2272 SetDelegate(delegate); | 2273 SetDelegate(delegate); |
2273 CoreTabHelper::FromWebContents(web_contents)->set_delegate(delegate); | 2274 CoreTabHelper::FromWebContents(web_contents)->set_delegate(delegate); |
2274 SearchEngineTabHelper::FromWebContents(web_contents)->set_delegate(delegate); | 2275 SearchEngineTabHelper::FromWebContents(web_contents)->set_delegate(delegate); |
2275 SearchTabHelper::FromWebContents(web_contents)->set_delegate(delegate); | 2276 SearchTabHelper::FromWebContents(web_contents)->set_delegate(delegate); |
2276 translate::ContentTranslateDriver& content_translate_driver = | 2277 translate::ContentTranslateDriver& content_translate_driver = |
2277 ChromeTranslateClient::FromWebContents(web_contents)->translate_driver(); | 2278 ChromeTranslateClient::FromWebContents(web_contents)->translate_driver(); |
2278 if (delegate) { | 2279 if (delegate) { |
2279 ZoomController::FromWebContents(web_contents)->AddObserver(this); | 2280 ui_zoom::ZoomController::FromWebContents(web_contents)->AddObserver(this); |
2280 content_translate_driver.AddObserver(translate_driver_observer_.get()); | 2281 content_translate_driver.AddObserver(translate_driver_observer_.get()); |
2281 } else { | 2282 } else { |
2282 ZoomController::FromWebContents(web_contents)->RemoveObserver(this); | 2283 ui_zoom::ZoomController::FromWebContents(web_contents) |
| 2284 ->RemoveObserver(this); |
2283 content_translate_driver.RemoveObserver(translate_driver_observer_.get()); | 2285 content_translate_driver.RemoveObserver(translate_driver_observer_.get()); |
2284 } | 2286 } |
2285 } | 2287 } |
2286 | 2288 |
2287 void Browser::CloseFrame() { | 2289 void Browser::CloseFrame() { |
2288 window_->Close(); | 2290 window_->Close(); |
2289 } | 2291 } |
2290 | 2292 |
2291 void Browser::TabDetachedAtImpl(content::WebContents* contents, | 2293 void Browser::TabDetachedAtImpl(content::WebContents* contents, |
2292 int index, | 2294 int index, |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2524 if (contents && !allow_js_access) { | 2526 if (contents && !allow_js_access) { |
2525 contents->web_contents()->GetController().LoadURL( | 2527 contents->web_contents()->GetController().LoadURL( |
2526 target_url, | 2528 target_url, |
2527 content::Referrer(), | 2529 content::Referrer(), |
2528 ui::PAGE_TRANSITION_LINK, | 2530 ui::PAGE_TRANSITION_LINK, |
2529 std::string()); // No extra headers. | 2531 std::string()); // No extra headers. |
2530 } | 2532 } |
2531 | 2533 |
2532 return contents != NULL; | 2534 return contents != NULL; |
2533 } | 2535 } |
OLD | NEW |