Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 7572022: Use bookmark manager to add/edit bookmark pages with webui_dialogs=1. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Windows build compatibility. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 browser::NavigateParams params(GetSingletonTabNavigateParams( 1955 browser::NavigateParams params(GetSingletonTabNavigateParams(
1955 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()))));
1957 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; 1959 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE;
1958 ShowSingletonTabOverwritingNTP(params); 1960 ShowSingletonTabOverwritingNTP(params);
1959 } 1961 }
1960 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);
1973 }
1974
1961 void Browser::ShowAppMenu() { 1975 void Browser::ShowAppMenu() {
1962 // We record the user metric for this event in WrenchMenu::RunMenu. 1976 // We record the user metric for this event in WrenchMenu::RunMenu.
1963 window_->ShowAppMenu(); 1977 window_->ShowAppMenu();
1964 } 1978 }
1965 1979
1966 void Browser::ShowHistoryTab() { 1980 void Browser::ShowHistoryTab() {
1967 UserMetrics::RecordAction(UserMetricsAction("ShowHistory")); 1981 UserMetrics::RecordAction(UserMetricsAction("ShowHistory"));
1968 ShowSingletonTabOverwritingNTP( 1982 ShowSingletonTabOverwritingNTP(
1969 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIHistoryURL))); 1983 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIHistoryURL)));
1970 } 1984 }
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after
4860 } 4874 }
4861 4875
4862 void Browser::ShowSyncSetup() { 4876 void Browser::ShowSyncSetup() {
4863 ProfileSyncService* service = 4877 ProfileSyncService* service =
4864 profile()->GetOriginalProfile()->GetProfileSyncService(); 4878 profile()->GetOriginalProfile()->GetProfileSyncService();
4865 if (service->HasSyncSetupCompleted()) 4879 if (service->HasSyncSetupCompleted())
4866 ShowOptionsTab(chrome::kSyncSetupSubPage); 4880 ShowOptionsTab(chrome::kSyncSetupSubPage);
4867 else 4881 else
4868 service->ShowLoginDialog(); 4882 service->ShowLoginDialog();
4869 } 4883 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698