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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 43 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
44 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" | 44 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" |
45 #include "chrome/browser/custom_handlers/register_protocol_handler_permission_re
quest.h" | 45 #include "chrome/browser/custom_handlers/register_protocol_handler_permission_re
quest.h" |
46 #include "chrome/browser/defaults.h" | 46 #include "chrome/browser/defaults.h" |
47 #include "chrome/browser/devtools/devtools_toggle_action.h" | 47 #include "chrome/browser/devtools/devtools_toggle_action.h" |
48 #include "chrome/browser/devtools/devtools_window.h" | 48 #include "chrome/browser/devtools/devtools_window.h" |
49 #include "chrome/browser/download/download_item_model.h" | 49 #include "chrome/browser/download/download_item_model.h" |
50 #include "chrome/browser/download/download_service.h" | 50 #include "chrome/browser/download/download_service.h" |
51 #include "chrome/browser/download/download_service_factory.h" | 51 #include "chrome/browser/download/download_service_factory.h" |
52 #include "chrome/browser/download/download_shelf.h" | 52 #include "chrome/browser/download/download_shelf.h" |
| 53 #include "chrome/browser/extensions/api/tabs/tabs_event_router.h" |
| 54 #include "chrome/browser/extensions/api/tabs/tabs_windows_api.h" |
53 #include "chrome/browser/extensions/browser_extension_window_controller.h" | 55 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
54 #include "chrome/browser/extensions/extension_service.h" | 56 #include "chrome/browser/extensions/extension_service.h" |
55 #include "chrome/browser/extensions/tab_helper.h" | 57 #include "chrome/browser/extensions/tab_helper.h" |
56 #include "chrome/browser/favicon/favicon_tab_helper.h" | 58 #include "chrome/browser/favicon/favicon_tab_helper.h" |
57 #include "chrome/browser/file_select_helper.h" | 59 #include "chrome/browser/file_select_helper.h" |
58 #include "chrome/browser/first_run/first_run.h" | 60 #include "chrome/browser/first_run/first_run.h" |
59 #include "chrome/browser/history/top_sites.h" | 61 #include "chrome/browser/history/top_sites.h" |
60 #include "chrome/browser/infobars/infobar_service.h" | 62 #include "chrome/browser/infobars/infobar_service.h" |
61 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h" | 63 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h" |
62 #include "chrome/browser/lifetime/application_lifetime.h" | 64 #include "chrome/browser/lifetime/application_lifetime.h" |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1843 | 1845 |
1844 void Browser::OnZoomChanged(content::WebContents* source, | 1846 void Browser::OnZoomChanged(content::WebContents* source, |
1845 bool can_show_bubble) { | 1847 bool can_show_bubble) { |
1846 if (source == tab_strip_model_->GetActiveWebContents()) { | 1848 if (source == tab_strip_model_->GetActiveWebContents()) { |
1847 // Only show the zoom bubble for zoom changes in the active window. | 1849 // Only show the zoom bubble for zoom changes in the active window. |
1848 window_->ZoomChangedForActiveTab(can_show_bubble && window_->IsActive() && | 1850 window_->ZoomChangedForActiveTab(can_show_bubble && window_->IsActive() && |
1849 !is_devtools()); | 1851 !is_devtools()); |
1850 } | 1852 } |
1851 } | 1853 } |
1852 | 1854 |
| 1855 void Browser::OnZoomChangeInitiated(content::WebContents* web_contents, |
| 1856 double old_zoom_level, |
| 1857 double new_zoom_level, |
| 1858 ZoomMode zoom_mode) { |
| 1859 // TODO(wjmaclean) Is there any way we could hook the TabsEventRouter up |
| 1860 // directly as a ZoomObserver? |
| 1861 extensions::TabsWindowsAPI* tabs_windows_api = |
| 1862 extensions::TabsWindowsAPI::Get(web_contents->GetBrowserContext()); |
| 1863 tabs_windows_api->tabs_event_router()->OnZoomChangeInitiated( |
| 1864 web_contents, old_zoom_level, new_zoom_level, zoom_mode); |
| 1865 } |
| 1866 |
1853 /////////////////////////////////////////////////////////////////////////////// | 1867 /////////////////////////////////////////////////////////////////////////////// |
1854 // Browser, ui::SelectFileDialog::Listener implementation: | 1868 // Browser, ui::SelectFileDialog::Listener implementation: |
1855 | 1869 |
1856 void Browser::FileSelected(const base::FilePath& path, int index, | 1870 void Browser::FileSelected(const base::FilePath& path, int index, |
1857 void* params) { | 1871 void* params) { |
1858 FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params); | 1872 FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params); |
1859 } | 1873 } |
1860 | 1874 |
1861 void Browser::FileSelectedWithExtraInfo(const ui::SelectedFileInfo& file_info, | 1875 void Browser::FileSelectedWithExtraInfo(const ui::SelectedFileInfo& file_info, |
1862 int index, | 1876 int index, |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2418 if (contents && !allow_js_access) { | 2432 if (contents && !allow_js_access) { |
2419 contents->web_contents()->GetController().LoadURL( | 2433 contents->web_contents()->GetController().LoadURL( |
2420 target_url, | 2434 target_url, |
2421 content::Referrer(), | 2435 content::Referrer(), |
2422 content::PAGE_TRANSITION_LINK, | 2436 content::PAGE_TRANSITION_LINK, |
2423 std::string()); // No extra headers. | 2437 std::string()); // No extra headers. |
2424 } | 2438 } |
2425 | 2439 |
2426 return contents != NULL; | 2440 return contents != NULL; |
2427 } | 2441 } |
OLD | NEW |