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

Unified Diff: chrome/browser/ui/browser.cc

Issue 7178002: Open Options page on top of NTP. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Refactor settings API methods together. Switch test order. Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/browser_navigator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 6aa58ae6492db57c639601ec112ef2a85efc902c..d91e4602fee411ca2b51b2b034c033459e466860 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -78,6 +78,7 @@
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/download/download_tab_helper.h"
@@ -1985,9 +1986,16 @@ void Browser::ShowBrokenPageTab(TabContents* contents) {
}
void Browser::ShowOptionsTab(const std::string& sub_page) {
- GURL url(chrome::kChromeUISettingsURL + sub_page);
- browser::NavigateParams params(GetSingletonTabNavigateParams(url));
+ browser::NavigateParams params(GetSingletonTabNavigateParams(
+ GURL(chrome::kChromeUISettingsURL + sub_page)));
params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE;
+
+ if ((GetSelectedTabContents()->GetURL() == GURL(chrome::kChromeUINewTabURL) ||
+ GetSelectedTabContents()->GetURL() == GURL(chrome::kAboutBlankURL)) &&
+ browser::GetIndexOfSingletonTab(&params) < 0) {
+ params.disposition = CURRENT_TAB;
+ }
+
browser::Navigate(&params);
}
@@ -1998,10 +2006,7 @@ void Browser::OpenClearBrowsingDataDialog() {
void Browser::OpenOptionsDialog() {
UserMetrics::RecordAction(UserMetricsAction("ShowOptions"));
- GURL url(chrome::kChromeUISettingsURL);
- browser::NavigateParams params(GetSingletonTabNavigateParams(url));
- params.path_behavior = browser::NavigateParams::IGNORE_AND_STAY_PUT;
- browser::Navigate(&params);
+ ShowOptionsTab("");
}
void Browser::OpenPasswordManager() {
« no previous file with comments | « no previous file | chrome/browser/ui/browser_navigator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698