| 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 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1941 window_->ToggleBookmarkBar(); | 1941 window_->ToggleBookmarkBar(); |
| 1942 } | 1942 } |
| 1943 | 1943 |
| 1944 void Browser::OpenBookmarkManager() { | 1944 void Browser::OpenBookmarkManager() { |
| 1945 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); | 1945 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); |
| 1946 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks")); | 1946 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks")); |
| 1947 ShowSingletonTabOverwritingNTP( | 1947 ShowSingletonTabOverwritingNTP( |
| 1948 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIBookmarksURL))); | 1948 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIBookmarksURL))); |
| 1949 } | 1949 } |
| 1950 | 1950 |
| 1951 void Browser::OpenBookmarkManagerForNode(int64 node_id) { | 1951 void Browser::OpenBookmarkManagerWithHash(const std::string& action, |
| 1952 int64 node_id) { |
| 1952 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); | 1953 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); |
| 1953 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks")); | 1954 UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks")); |
| 1954 ShowSingletonTabOverwritingNTP( | 1955 browser::NavigateParams params(GetSingletonTabNavigateParams( |
| 1955 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIBookmarksURL).Resolve( | 1956 GURL(chrome::kChromeUIBookmarksURL).Resolve( |
| 1956 StringPrintf("/#%s", base::Int64ToString(node_id).c_str())))); | 1957 StringPrintf("/#%s%s", action.c_str(), |
| 1958 base::Int64ToString(node_id).c_str())))); |
| 1959 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; |
| 1960 ShowSingletonTabOverwritingNTP(params); |
| 1961 } |
| 1962 |
| 1963 void Browser::OpenBookmarkManagerForNode(int64 node_id) { |
| 1964 OpenBookmarkManagerWithHash("", node_id); |
| 1965 } |
| 1966 |
| 1967 void Browser::OpenBookmarkManagerEditNode(int64 node_id) { |
| 1968 OpenBookmarkManagerWithHash("e=", node_id); |
| 1969 } |
| 1970 |
| 1971 void Browser::OpenBookmarkManagerAddNodeIn(int64 node_id) { |
| 1972 OpenBookmarkManagerWithHash("a=", node_id); |
| 1957 } | 1973 } |
| 1958 | 1974 |
| 1959 void Browser::ShowAppMenu() { | 1975 void Browser::ShowAppMenu() { |
| 1960 // We record the user metric for this event in WrenchMenu::RunMenu. | 1976 // We record the user metric for this event in WrenchMenu::RunMenu. |
| 1961 window_->ShowAppMenu(); | 1977 window_->ShowAppMenu(); |
| 1962 } | 1978 } |
| 1963 | 1979 |
| 1964 void Browser::ShowHistoryTab() { | 1980 void Browser::ShowHistoryTab() { |
| 1965 UserMetrics::RecordAction(UserMetricsAction("ShowHistory")); | 1981 UserMetrics::RecordAction(UserMetricsAction("ShowHistory")); |
| 1966 ShowSingletonTabOverwritingNTP( | 1982 ShowSingletonTabOverwritingNTP( |
| (...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4836 } | 4852 } |
| 4837 | 4853 |
| 4838 void Browser::ShowSyncSetup() { | 4854 void Browser::ShowSyncSetup() { |
| 4839 ProfileSyncService* service = | 4855 ProfileSyncService* service = |
| 4840 profile()->GetOriginalProfile()->GetProfileSyncService(); | 4856 profile()->GetOriginalProfile()->GetProfileSyncService(); |
| 4841 if (service->HasSyncSetupCompleted()) | 4857 if (service->HasSyncSetupCompleted()) |
| 4842 ShowOptionsTab(chrome::kSyncSetupSubPage); | 4858 ShowOptionsTab(chrome::kSyncSetupSubPage); |
| 4843 else | 4859 else |
| 4844 service->ShowLoginDialog(); | 4860 service->ShowLoginDialog(); |
| 4845 } | 4861 } |
| OLD | NEW |