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