| 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.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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 136 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 137 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 137 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 138 #include "chrome/browser/ui/tabs/dock_info.h" | 138 #include "chrome/browser/ui/tabs/dock_info.h" |
| 139 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 139 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 140 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 140 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 141 #include "chrome/browser/ui/unload_controller.h" | 141 #include "chrome/browser/ui/unload_controller.h" |
| 142 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 142 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
| 143 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 143 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 144 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 144 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 145 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 145 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 146 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 146 #include "chrome/browser/upgrade_detector.h" | 147 #include "chrome/browser/upgrade_detector.h" |
| 147 #include "chrome/browser/web_applications/web_app.h" | 148 #include "chrome/browser/web_applications/web_app.h" |
| 148 #include "chrome/common/chrome_constants.h" | 149 #include "chrome/common/chrome_constants.h" |
| 149 #include "chrome/common/chrome_notification_types.h" | 150 #include "chrome/common/chrome_notification_types.h" |
| 150 #include "chrome/common/chrome_switches.h" | 151 #include "chrome/common/chrome_switches.h" |
| 151 #include "chrome/common/custom_handlers/protocol_handler.h" | 152 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 152 #include "chrome/common/extensions/extension.h" | 153 #include "chrome/common/extensions/extension.h" |
| 153 #include "chrome/common/extensions/extension_constants.h" | 154 #include "chrome/common/extensions/extension_constants.h" |
| 154 #include "chrome/common/pref_names.h" | 155 #include "chrome/common/pref_names.h" |
| 155 #include "chrome/common/profiling.h" | 156 #include "chrome/common/profiling.h" |
| (...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 // Browser, BookmarkTabHelperDelegate implementation: | 1759 // Browser, BookmarkTabHelperDelegate implementation: |
| 1759 | 1760 |
| 1760 void Browser::URLStarredChanged(TabContents* source, bool starred) { | 1761 void Browser::URLStarredChanged(TabContents* source, bool starred) { |
| 1761 if (source == chrome::GetActiveTabContents(this)) | 1762 if (source == chrome::GetActiveTabContents(this)) |
| 1762 window_->SetStarredState(starred); | 1763 window_->SetStarredState(starred); |
| 1763 } | 1764 } |
| 1764 | 1765 |
| 1765 /////////////////////////////////////////////////////////////////////////////// | 1766 /////////////////////////////////////////////////////////////////////////////// |
| 1766 // Browser, ZoomObserver implementation: | 1767 // Browser, ZoomObserver implementation: |
| 1767 | 1768 |
| 1768 void Browser::OnZoomIconChanged(TabContents* source, | 1769 void Browser::OnZoomChanged(TabContents* source, bool can_show_bubble) { |
| 1769 ZoomController::ZoomIconState state) { | |
| 1770 if (source == chrome::GetActiveTabContents(this)) | |
| 1771 window_->SetZoomIconState(state); | |
| 1772 } | |
| 1773 | |
| 1774 void Browser::OnZoomChanged(TabContents* source, | |
| 1775 int zoom_percent, | |
| 1776 bool can_show_bubble) { | |
| 1777 if (source == chrome::GetActiveTabContents(this)) { | 1770 if (source == chrome::GetActiveTabContents(this)) { |
| 1778 window_->SetZoomIconTooltipPercent(zoom_percent); | |
| 1779 | |
| 1780 // Only show the zoom bubble for zoom changes in the active window. | 1771 // Only show the zoom bubble for zoom changes in the active window. |
| 1781 if (can_show_bubble && window_->IsActive()) | 1772 window_->ZoomChangedForActiveTab(can_show_bubble && window_->IsActive()); |
| 1782 window_->ShowZoomBubble(zoom_percent); | |
| 1783 } | 1773 } |
| 1784 } | 1774 } |
| 1785 | 1775 |
| 1786 /////////////////////////////////////////////////////////////////////////////// | 1776 /////////////////////////////////////////////////////////////////////////////// |
| 1787 // Browser, ui::SelectFileDialog::Listener implementation: | 1777 // Browser, ui::SelectFileDialog::Listener implementation: |
| 1788 | 1778 |
| 1789 void Browser::FileSelected(const FilePath& path, int index, void* params) { | 1779 void Browser::FileSelected(const FilePath& path, int index, void* params) { |
| 1790 FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params); | 1780 FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params); |
| 1791 } | 1781 } |
| 1792 | 1782 |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2318 if (contents && !allow_js_access) { | 2308 if (contents && !allow_js_access) { |
| 2319 contents->web_contents()->GetController().LoadURL( | 2309 contents->web_contents()->GetController().LoadURL( |
| 2320 target_url, | 2310 target_url, |
| 2321 content::Referrer(), | 2311 content::Referrer(), |
| 2322 content::PAGE_TRANSITION_LINK, | 2312 content::PAGE_TRANSITION_LINK, |
| 2323 std::string()); // No extra headers. | 2313 std::string()); // No extra headers. |
| 2324 } | 2314 } |
| 2325 | 2315 |
| 2326 return contents != NULL; | 2316 return contents != NULL; |
| 2327 } | 2317 } |
| OLD | NEW |