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 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 #include "components/favicon/content/content_favicon_driver.h" | 168 #include "components/favicon/content/content_favicon_driver.h" |
169 #include "components/history/core/browser/top_sites.h" | 169 #include "components/history/core/browser/top_sites.h" |
170 #include "components/prefs/pref_service.h" | 170 #include "components/prefs/pref_service.h" |
171 #include "components/search/search.h" | 171 #include "components/search/search.h" |
172 #include "components/security_state/security_state_model.h" | 172 #include "components/security_state/security_state_model.h" |
173 #include "components/sessions/core/session_types.h" | 173 #include "components/sessions/core/session_types.h" |
174 #include "components/sessions/core/tab_restore_service.h" | 174 #include "components/sessions/core/tab_restore_service.h" |
175 #include "components/startup_metric_utils/browser/startup_metric_utils.h" | 175 #include "components/startup_metric_utils/browser/startup_metric_utils.h" |
176 #include "components/toolbar/toolbar_model_impl.h" | 176 #include "components/toolbar/toolbar_model_impl.h" |
177 #include "components/translate/core/browser/language_state.h" | 177 #include "components/translate/core/browser/language_state.h" |
178 #include "components/ui/zoom/zoom_controller.h" | |
179 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 178 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 179 #include "components/zoom/zoom_controller.h" |
180 #include "content/public/browser/devtools_agent_host.h" | 180 #include "content/public/browser/devtools_agent_host.h" |
181 #include "content/public/browser/interstitial_page.h" | 181 #include "content/public/browser/interstitial_page.h" |
182 #include "content/public/browser/invalidate_type.h" | 182 #include "content/public/browser/invalidate_type.h" |
183 #include "content/public/browser/navigation_controller.h" | 183 #include "content/public/browser/navigation_controller.h" |
184 #include "content/public/browser/navigation_entry.h" | 184 #include "content/public/browser/navigation_entry.h" |
185 #include "content/public/browser/notification_details.h" | 185 #include "content/public/browser/notification_details.h" |
186 #include "content/public/browser/notification_service.h" | 186 #include "content/public/browser/notification_service.h" |
187 #include "content/public/browser/plugin_service.h" | 187 #include "content/public/browser/plugin_service.h" |
188 #include "content/public/browser/render_frame_host.h" | 188 #include "content/public/browser/render_frame_host.h" |
189 #include "content/public/browser/render_process_host.h" | 189 #include "content/public/browser/render_process_host.h" |
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1936 void Browser::URLStarredChanged(content::WebContents* web_contents, | 1936 void Browser::URLStarredChanged(content::WebContents* web_contents, |
1937 bool starred) { | 1937 bool starred) { |
1938 if (web_contents == tab_strip_model_->GetActiveWebContents()) | 1938 if (web_contents == tab_strip_model_->GetActiveWebContents()) |
1939 window_->SetStarredState(starred); | 1939 window_->SetStarredState(starred); |
1940 } | 1940 } |
1941 | 1941 |
1942 /////////////////////////////////////////////////////////////////////////////// | 1942 /////////////////////////////////////////////////////////////////////////////// |
1943 // Browser, ZoomObserver implementation: | 1943 // Browser, ZoomObserver implementation: |
1944 | 1944 |
1945 void Browser::OnZoomChanged( | 1945 void Browser::OnZoomChanged( |
1946 const ui_zoom::ZoomController::ZoomChangedEventData& data) { | 1946 const zoom::ZoomController::ZoomChangedEventData& data) { |
1947 if (data.web_contents == tab_strip_model_->GetActiveWebContents()) { | 1947 if (data.web_contents == tab_strip_model_->GetActiveWebContents()) { |
1948 window_->ZoomChangedForActiveTab(data.can_show_bubble); | 1948 window_->ZoomChangedForActiveTab(data.can_show_bubble); |
1949 // Change the zoom commands state based on the zoom state | 1949 // Change the zoom commands state based on the zoom state |
1950 command_controller_->ZoomStateChanged(); | 1950 command_controller_->ZoomStateChanged(); |
1951 } | 1951 } |
1952 } | 1952 } |
1953 | 1953 |
1954 /////////////////////////////////////////////////////////////////////////////// | 1954 /////////////////////////////////////////////////////////////////////////////// |
1955 // Browser, ui::SelectFileDialog::Listener implementation: | 1955 // Browser, ui::SelectFileDialog::Listener implementation: |
1956 | 1956 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2341 | 2341 |
2342 // ...and all the helpers. | 2342 // ...and all the helpers. |
2343 BookmarkTabHelper::FromWebContents(web_contents)->set_delegate(delegate); | 2343 BookmarkTabHelper::FromWebContents(web_contents)->set_delegate(delegate); |
2344 WebContentsModalDialogManager::FromWebContents(web_contents)-> | 2344 WebContentsModalDialogManager::FromWebContents(web_contents)-> |
2345 SetDelegate(delegate); | 2345 SetDelegate(delegate); |
2346 CoreTabHelper::FromWebContents(web_contents)->set_delegate(delegate); | 2346 CoreTabHelper::FromWebContents(web_contents)->set_delegate(delegate); |
2347 SearchTabHelper::FromWebContents(web_contents)->set_delegate(delegate); | 2347 SearchTabHelper::FromWebContents(web_contents)->set_delegate(delegate); |
2348 translate::ContentTranslateDriver& content_translate_driver = | 2348 translate::ContentTranslateDriver& content_translate_driver = |
2349 ChromeTranslateClient::FromWebContents(web_contents)->translate_driver(); | 2349 ChromeTranslateClient::FromWebContents(web_contents)->translate_driver(); |
2350 if (delegate) { | 2350 if (delegate) { |
2351 ui_zoom::ZoomController::FromWebContents(web_contents)->AddObserver(this); | 2351 zoom::ZoomController::FromWebContents(web_contents)->AddObserver(this); |
2352 content_translate_driver.AddObserver(this); | 2352 content_translate_driver.AddObserver(this); |
2353 } else { | 2353 } else { |
2354 ui_zoom::ZoomController::FromWebContents(web_contents)->RemoveObserver( | 2354 zoom::ZoomController::FromWebContents(web_contents)->RemoveObserver(this); |
2355 this); | |
2356 content_translate_driver.RemoveObserver(this); | 2355 content_translate_driver.RemoveObserver(this); |
2357 } | 2356 } |
2358 } | 2357 } |
2359 | 2358 |
2360 void Browser::CloseFrame() { | 2359 void Browser::CloseFrame() { |
2361 window_->Close(); | 2360 window_->Close(); |
2362 } | 2361 } |
2363 | 2362 |
2364 void Browser::TabDetachedAtImpl(content::WebContents* contents, | 2363 void Browser::TabDetachedAtImpl(content::WebContents* contents, |
2365 int index, | 2364 int index, |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 if (contents && !allow_js_access) { | 2598 if (contents && !allow_js_access) { |
2600 contents->web_contents()->GetController().LoadURL( | 2599 contents->web_contents()->GetController().LoadURL( |
2601 target_url, | 2600 target_url, |
2602 content::Referrer(), | 2601 content::Referrer(), |
2603 ui::PAGE_TRANSITION_LINK, | 2602 ui::PAGE_TRANSITION_LINK, |
2604 std::string()); // No extra headers. | 2603 std::string()); // No extra headers. |
2605 } | 2604 } |
2606 | 2605 |
2607 return contents != NULL; | 2606 return contents != NULL; |
2608 } | 2607 } |
OLD | NEW |