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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 #include "content/browser/plugin_service.h" | 144 #include "content/browser/plugin_service.h" |
145 #include "content/browser/renderer_host/render_view_host.h" | 145 #include "content/browser/renderer_host/render_view_host.h" |
146 #include "content/browser/site_instance.h" | 146 #include "content/browser/site_instance.h" |
147 #include "content/browser/tab_contents/interstitial_page.h" | 147 #include "content/browser/tab_contents/interstitial_page.h" |
148 #include "content/browser/tab_contents/navigation_controller.h" | 148 #include "content/browser/tab_contents/navigation_controller.h" |
149 #include "content/browser/tab_contents/navigation_entry.h" | 149 #include "content/browser/tab_contents/navigation_entry.h" |
150 #include "content/browser/tab_contents/tab_contents_view.h" | 150 #include "content/browser/tab_contents/tab_contents_view.h" |
151 #include "content/browser/user_metrics.h" | 151 #include "content/browser/user_metrics.h" |
152 #include "content/common/content_restriction.h" | 152 #include "content/common/content_restriction.h" |
153 #include "content/public/browser/notification_service.h" | 153 #include "content/public/browser/notification_service.h" |
154 #include "content/common/page_zoom.h" | |
155 #include "content/public/browser/notification_details.h" | 154 #include "content/public/browser/notification_details.h" |
156 #include "content/public/common/content_switches.h" | 155 #include "content/public/common/content_switches.h" |
157 #include "grit/chromium_strings.h" | 156 #include "grit/chromium_strings.h" |
158 #include "grit/generated_resources.h" | 157 #include "grit/generated_resources.h" |
159 #include "grit/locale_settings.h" | 158 #include "grit/locale_settings.h" |
160 #include "grit/theme_resources_standard.h" | 159 #include "grit/theme_resources_standard.h" |
161 #include "net/base/cookie_monster.h" | 160 #include "net/base/cookie_monster.h" |
162 #include "net/base/net_util.h" | 161 #include "net/base/net_util.h" |
163 #include "net/base/registry_controlled_domain.h" | 162 #include "net/base/registry_controlled_domain.h" |
164 #include "net/url_request/url_request_context.h" | 163 #include "net/url_request/url_request_context.h" |
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1964 void Browser::FindNext() { | 1963 void Browser::FindNext() { |
1965 UserMetrics::RecordAction(UserMetricsAction("FindNext")); | 1964 UserMetrics::RecordAction(UserMetricsAction("FindNext")); |
1966 FindInPage(true, true); | 1965 FindInPage(true, true); |
1967 } | 1966 } |
1968 | 1967 |
1969 void Browser::FindPrevious() { | 1968 void Browser::FindPrevious() { |
1970 UserMetrics::RecordAction(UserMetricsAction("FindPrevious")); | 1969 UserMetrics::RecordAction(UserMetricsAction("FindPrevious")); |
1971 FindInPage(true, false); | 1970 FindInPage(true, false); |
1972 } | 1971 } |
1973 | 1972 |
1974 void Browser::Zoom(PageZoom::Function zoom_function) { | 1973 void Browser::Zoom(content::PageZoom zoom) { |
1975 if (is_devtools()) | 1974 if (is_devtools()) |
1976 return; | 1975 return; |
1977 | 1976 |
1978 static const UserMetricsAction kActions[] = { | 1977 static const UserMetricsAction kActions[] = { |
1979 UserMetricsAction("ZoomMinus"), | 1978 UserMetricsAction("ZoomMinus"), |
1980 UserMetricsAction("ZoomNormal"), | 1979 UserMetricsAction("ZoomNormal"), |
1981 UserMetricsAction("ZoomPlus") | 1980 UserMetricsAction("ZoomPlus") |
1982 }; | 1981 }; |
1983 | 1982 |
1984 UserMetrics::RecordAction(kActions[zoom_function - PageZoom::ZOOM_OUT]); | 1983 UserMetrics::RecordAction(kActions[zoom - content::PAGE_ZOOM_OUT]); |
1985 TabContentsWrapper* tab_contents = GetSelectedTabContentsWrapper(); | 1984 TabContentsWrapper* tab_contents = GetSelectedTabContentsWrapper(); |
1986 RenderViewHost* host = tab_contents->render_view_host(); | 1985 RenderViewHost* host = tab_contents->render_view_host(); |
1987 host->Zoom(zoom_function); | 1986 host->Zoom(zoom); |
1988 } | 1987 } |
1989 | 1988 |
1990 void Browser::FocusToolbar() { | 1989 void Browser::FocusToolbar() { |
1991 UserMetrics::RecordAction(UserMetricsAction("FocusToolbar")); | 1990 UserMetrics::RecordAction(UserMetricsAction("FocusToolbar")); |
1992 window_->FocusToolbar(); | 1991 window_->FocusToolbar(); |
1993 } | 1992 } |
1994 | 1993 |
1995 void Browser::FocusAppMenu() { | 1994 void Browser::FocusAppMenu() { |
1996 UserMetrics::RecordAction(UserMetricsAction("FocusAppMenu")); | 1995 UserMetrics::RecordAction(UserMetricsAction("FocusAppMenu")); |
1997 window_->FocusAppMenu(); | 1996 window_->FocusAppMenu(); |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2788 case IDC_CUT: Cut(); break; | 2787 case IDC_CUT: Cut(); break; |
2789 case IDC_COPY: Copy(); break; | 2788 case IDC_COPY: Copy(); break; |
2790 case IDC_PASTE: Paste(); break; | 2789 case IDC_PASTE: Paste(); break; |
2791 | 2790 |
2792 // Find-in-page | 2791 // Find-in-page |
2793 case IDC_FIND: Find(); break; | 2792 case IDC_FIND: Find(); break; |
2794 case IDC_FIND_NEXT: FindNext(); break; | 2793 case IDC_FIND_NEXT: FindNext(); break; |
2795 case IDC_FIND_PREVIOUS: FindPrevious(); break; | 2794 case IDC_FIND_PREVIOUS: FindPrevious(); break; |
2796 | 2795 |
2797 // Zoom | 2796 // Zoom |
2798 case IDC_ZOOM_PLUS: Zoom(PageZoom::ZOOM_IN); break; | 2797 case IDC_ZOOM_PLUS: Zoom(content::PAGE_ZOOM_IN); break; |
2799 case IDC_ZOOM_NORMAL: Zoom(PageZoom::RESET); break; | 2798 case IDC_ZOOM_NORMAL: Zoom(content::PAGE_ZOOM_RESET); break; |
2800 case IDC_ZOOM_MINUS: Zoom(PageZoom::ZOOM_OUT); break; | 2799 case IDC_ZOOM_MINUS: Zoom(content::PAGE_ZOOM_OUT); break; |
2801 | 2800 |
2802 // Focus various bits of UI | 2801 // Focus various bits of UI |
2803 case IDC_FOCUS_TOOLBAR: FocusToolbar(); break; | 2802 case IDC_FOCUS_TOOLBAR: FocusToolbar(); break; |
2804 case IDC_FOCUS_LOCATION: FocusLocationBar(); break; | 2803 case IDC_FOCUS_LOCATION: FocusLocationBar(); break; |
2805 case IDC_FOCUS_SEARCH: FocusSearch(); break; | 2804 case IDC_FOCUS_SEARCH: FocusSearch(); break; |
2806 case IDC_FOCUS_MENU_BAR: FocusAppMenu(); break; | 2805 case IDC_FOCUS_MENU_BAR: FocusAppMenu(); break; |
2807 case IDC_FOCUS_BOOKMARKS: FocusBookmarksToolbar(); break; | 2806 case IDC_FOCUS_BOOKMARKS: FocusBookmarksToolbar(); break; |
2808 case IDC_FOCUS_CHROMEOS_STATUS: FocusChromeOSStatus(); break; | 2807 case IDC_FOCUS_CHROMEOS_STATUS: FocusChromeOSStatus(); break; |
2809 case IDC_FOCUS_NEXT_PANE: FocusNextPane(); break; | 2808 case IDC_FOCUS_NEXT_PANE: FocusNextPane(); break; |
2810 case IDC_FOCUS_PREVIOUS_PANE: FocusPreviousPane(); break; | 2809 case IDC_FOCUS_PREVIOUS_PANE: FocusPreviousPane(); break; |
(...skipping 2699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5510 } | 5509 } |
5511 | 5510 |
5512 void Browser::UpdateFullscreenExitBubbleContent() { | 5511 void Browser::UpdateFullscreenExitBubbleContent() { |
5513 GURL url; | 5512 GURL url; |
5514 if (fullscreened_tab_) | 5513 if (fullscreened_tab_) |
5515 url = fullscreened_tab_->tab_contents()->GetURL(); | 5514 url = fullscreened_tab_->tab_contents()->GetURL(); |
5516 | 5515 |
5517 window_->UpdateFullscreenExitBubbleContent( | 5516 window_->UpdateFullscreenExitBubbleContent( |
5518 url, GetFullscreenExitBubbleType()); | 5517 url, GetFullscreenExitBubbleType()); |
5519 } | 5518 } |
OLD | NEW |