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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 #include "chrome/browser/extensions/extension_prefs.h" | 42 #include "chrome/browser/extensions/extension_prefs.h" |
43 #include "chrome/browser/extensions/extension_service.h" | 43 #include "chrome/browser/extensions/extension_service.h" |
44 #include "chrome/browser/extensions/extension_tab_helper.h" | 44 #include "chrome/browser/extensions/extension_tab_helper.h" |
45 #include "chrome/browser/extensions/extension_tabs_module.h" | 45 #include "chrome/browser/extensions/extension_tabs_module.h" |
46 #include "chrome/browser/favicon/favicon_tab_helper.h" | 46 #include "chrome/browser/favicon/favicon_tab_helper.h" |
47 #include "chrome/browser/first_run/first_run.h" | 47 #include "chrome/browser/first_run/first_run.h" |
48 #include "chrome/browser/google/google_url_tracker.h" | 48 #include "chrome/browser/google/google_url_tracker.h" |
49 #include "chrome/browser/google/google_util.h" | 49 #include "chrome/browser/google/google_util.h" |
50 #include "chrome/browser/instant/instant_controller.h" | 50 #include "chrome/browser/instant/instant_controller.h" |
51 #include "chrome/browser/instant/instant_unload_handler.h" | 51 #include "chrome/browser/instant/instant_unload_handler.h" |
52 #include "chrome/browser/memory_purger.h" | |
52 #include "chrome/browser/net/browser_url_util.h" | 53 #include "chrome/browser/net/browser_url_util.h" |
53 #include "chrome/browser/net/url_fixer_upper.h" | 54 #include "chrome/browser/net/url_fixer_upper.h" |
54 #include "chrome/browser/notifications/notification_ui_manager.h" | 55 #include "chrome/browser/notifications/notification_ui_manager.h" |
55 #include "chrome/browser/platform_util.h" | 56 #include "chrome/browser/platform_util.h" |
56 #include "chrome/browser/prefs/pref_service.h" | 57 #include "chrome/browser/prefs/pref_service.h" |
57 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" | 58 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" |
58 #include "chrome/browser/profiles/profile.h" | 59 #include "chrome/browser/profiles/profile.h" |
59 #include "chrome/browser/sessions/restore_tab_helper.h" | 60 #include "chrome/browser/sessions/restore_tab_helper.h" |
60 #include "chrome/browser/sessions/session_service.h" | 61 #include "chrome/browser/sessions/session_service.h" |
61 #include "chrome/browser/sessions/session_service_factory.h" | 62 #include "chrome/browser/sessions/session_service_factory.h" |
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1921 UserMetrics::RecordAction(UserMetricsAction("ReportBug")); | 1922 UserMetrics::RecordAction(UserMetricsAction("ReportBug")); |
1922 browser::ShowHtmlBugReportView(this, std::string(), 0); | 1923 browser::ShowHtmlBugReportView(this, std::string(), 0); |
1923 } | 1924 } |
1924 | 1925 |
1925 void Browser::ToggleBookmarkBar() { | 1926 void Browser::ToggleBookmarkBar() { |
1926 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarksBar")); | 1927 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarksBar")); |
1927 window_->ToggleBookmarkBar(); | 1928 window_->ToggleBookmarkBar(); |
1928 } | 1929 } |
1929 | 1930 |
1930 void Browser::OpenBookmarkManager() { | 1931 void Browser::OpenBookmarkManager() { |
1932 LOG(INFO) << "Purging renderers"; | |
1933 MemoryPurger::PurgeRenderers(); | |
1931 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); | 1934 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); |
1932 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks")); | 1935 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks")); |
1933 ShowSingletonTabOverwritingNTP( | 1936 ShowSingletonTabOverwritingNTP( |
1934 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIBookmarksURL))); | 1937 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIBookmarksURL))); |
1938 | |
jam
2011/07/21 16:35:27
nit: extra line
Greg Billock
2011/07/21 19:10:01
Yeah, I'm going to revert this file. This was just
| |
1935 } | 1939 } |
1936 | 1940 |
1937 void Browser::OpenBookmarkManagerForNode(int64 node_id) { | 1941 void Browser::OpenBookmarkManagerForNode(int64 node_id) { |
1938 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); | 1942 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); |
1939 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks")); | 1943 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks")); |
1940 ShowSingletonTabOverwritingNTP( | 1944 ShowSingletonTabOverwritingNTP( |
1941 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIBookmarksURL).Resolve( | 1945 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIBookmarksURL).Resolve( |
1942 StringPrintf("/#%s", base::Int64ToString(node_id).c_str())))); | 1946 StringPrintf("/#%s", base::Int64ToString(node_id).c_str())))); |
1943 } | 1947 } |
1944 | 1948 |
(...skipping 2837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4782 window_->BookmarkBarStateChanged(animate_type); | 4786 window_->BookmarkBarStateChanged(animate_type); |
4783 } | 4787 } |
4784 | 4788 |
4785 void Browser::ShowSyncSetup() { | 4789 void Browser::ShowSyncSetup() { |
4786 ProfileSyncService* service = profile()->GetProfileSyncService(); | 4790 ProfileSyncService* service = profile()->GetProfileSyncService(); |
4787 if (service->HasSyncSetupCompleted()) | 4791 if (service->HasSyncSetupCompleted()) |
4788 ShowOptionsTab(chrome::kSyncSetupSubPage); | 4792 ShowOptionsTab(chrome::kSyncSetupSubPage); |
4789 else | 4793 else |
4790 profile()->GetProfileSyncService()->ShowLoginDialog(); | 4794 profile()->GetProfileSyncService()->ShowLoginDialog(); |
4791 } | 4795 } |
OLD | NEW |