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

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

Issue 2960143002: MD Bookmarks: Remove '/?id=1' from URL when displaying Bookmarks Bar (Closed)
Patch Set: Review comments Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_pages.h" 5 #include "chrome/browser/ui/chrome_pages.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 ? site_settings::ContentSettingsTypeToGroupName(type) 162 ? site_settings::ContentSettingsTypeToGroupName(type)
163 : it->second; 163 : it->second;
164 164
165 return std::string(kContentSettingsSubPage) + "/" + content_type_path; 165 return std::string(kContentSettingsSubPage) + "/" + content_type_path;
166 } 166 }
167 167
168 } // namespace 168 } // namespace
169 169
170 void ShowBookmarkManager(Browser* browser) { 170 void ShowBookmarkManager(Browser* browser) {
171 base::RecordAction(UserMetricsAction("ShowBookmarkManager")); 171 base::RecordAction(UserMetricsAction("ShowBookmarkManager"));
172 if (MdBookmarksUI::IsEnabled()) { 172 NavigateParams params(
173 const bookmarks::BookmarkNode* bookmark_bar_node =
174 BookmarkModelFactory::GetForBrowserContext(browser->profile())
175 ->bookmark_bar_node();
176 OpenBookmarkManagerForNode(browser, bookmark_bar_node->id());
177 return;
178 }
179
180 ShowSingletonTabOverwritingNTP(
181 browser,
182 GetSingletonTabNavigateParams(browser, GURL(kChromeUIBookmarksURL))); 173 GetSingletonTabNavigateParams(browser, GURL(kChromeUIBookmarksURL)));
174 params.path_behavior = NavigateParams::IGNORE_AND_STAY_PUT;
175 ShowSingletonTabOverwritingNTP(browser, params);
183 } 176 }
184 177
185 void ShowBookmarkManagerForNode(Browser* browser, int64_t node_id) { 178 void ShowBookmarkManagerForNode(Browser* browser, int64_t node_id) {
186 base::RecordAction(UserMetricsAction("ShowBookmarkManager")); 179 base::RecordAction(UserMetricsAction("ShowBookmarkManager"));
187 OpenBookmarkManagerForNode(browser, node_id); 180 OpenBookmarkManagerForNode(browser, node_id);
188 } 181 }
189 182
190 void ShowHistory(Browser* browser) { 183 void ShowHistory(Browser* browser) {
191 base::RecordAction(UserMetricsAction("ShowHistory")); 184 base::RecordAction(UserMetricsAction("ShowHistory"));
192 NavigateParams params( 185 NavigateParams params(
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 SigninManagerFactory::GetForProfile(original_profile); 421 SigninManagerFactory::GetForProfile(original_profile);
429 DCHECK(manager->IsSigninAllowed()); 422 DCHECK(manager->IsSigninAllowed());
430 if (manager->IsAuthenticated()) 423 if (manager->IsAuthenticated())
431 ShowSettings(browser); 424 ShowSettings(browser);
432 else 425 else
433 ShowBrowserSignin(browser, access_point); 426 ShowBrowserSignin(browser, access_point);
434 } 427 }
435 #endif 428 #endif
436 429
437 } // namespace chrome 430 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/util.js ('k') | chrome/browser/ui/webui/bookmarks_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698