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

Unified Diff: chrome/browser/dom_ui/new_tab_ui.cc

Issue 12895: Chromium-MultiProfile-Prototype... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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 | « chrome/browser/browser_process.h ('k') | chrome/browser/user_data_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/new_tab_ui.cc
===================================================================
--- chrome/browser/dom_ui/new_tab_ui.cc (revision 6272)
+++ chrome/browser/dom_ui/new_tab_ui.cc (working copy)
@@ -16,6 +16,7 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/render_view_host.h"
#include "chrome/browser/template_url.h"
+#include "chrome/browser/user_data_manager.h"
#include "chrome/browser/user_metrics.h"
#include "chrome/browser/views/keyword_editor_view.h"
#include "chrome/common/jstemplate_builder.h"
@@ -168,11 +169,27 @@
NOTREACHED();
return;
}
+
+ // Show the profile name in the title and most visited labels if the current
+ // profile is not the default.
+ std::wstring title;
+ std::wstring most_visited;
+ if (UserDataManager::Get()->is_current_profile_default()) {
+ title = l10n_util::GetString(IDS_NEW_TAB_TITLE);
+ most_visited = l10n_util::GetString(IDS_NEW_TAB_MOST_VISITED);
+ } else {
+ // Get the current profile name.
+ std::wstring profile_name =
+ UserDataManager::Get()->current_profile_name();
+ title = l10n_util::GetStringF(IDS_NEW_TAB_TITLE_WITH_PROFILE_NAME,
+ profile_name);
+ most_visited = l10n_util::GetStringF(
+ IDS_NEW_TAB_MOST_VISITED_WITH_PROFILE_NAME,
+ profile_name);
+ }
DictionaryValue localized_strings;
- localized_strings.SetString(L"title",
- l10n_util::GetString(IDS_NEW_TAB_TITLE));
- localized_strings.SetString(L"mostvisited",
- l10n_util::GetString(IDS_NEW_TAB_MOST_VISITED));
+ localized_strings.SetString(L"title", title);
+ localized_strings.SetString(L"mostvisited", most_visited);
localized_strings.SetString(L"searches",
l10n_util::GetString(IDS_NEW_TAB_SEARCHES));
localized_strings.SetString(L"bookmarks",
@@ -841,8 +858,18 @@
incognito_(false),
most_visited_handler_(NULL) {
set_type(TAB_CONTENTS_NEW_TAB_UI);
- set_forced_title(l10n_util::GetString(IDS_NEW_TAB_TITLE));
+ // Show profile name in the title if the current profile is not the default.
+ std::wstring title;
+ if (UserDataManager::Get()->is_current_profile_default()) {
+ title = l10n_util::GetString(IDS_NEW_TAB_TITLE);
+ } else {
+ title = l10n_util::GetStringF(
+ IDS_NEW_TAB_TITLE_WITH_PROFILE_NAME,
+ UserDataManager::Get()->current_profile_name());
+ }
+ set_forced_title(title);
+
if (profile->IsOffTheRecord())
incognito_ = true;
« no previous file with comments | « chrome/browser/browser_process.h ('k') | chrome/browser/user_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698