Commit 3af48b63 authored by noms@chromium.org's avatar noms@chromium.org

Change the title of the desktop User Manager widget.

The title of the window widget should be the product name (Chrome/Chromium).

Added a "close" button to make the last bubble in the tutorial dismissible.

BUG=399698,399697
TEST=Start Chrome with --new-avatar-menu. Choose "Switch person" from the
avatar menu of a brand new profile. Once you go through all the slides in
the tutorial, the last bubble which points to the "Add Person" button
should have a little x button in the top right corner. Also, the title of
the window should be "Chrome".

Review URL: https://codereview.chromium.org/440713005

Cr-Commit-Position: refs/heads/master@{#288385}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288385 0039d316-1c4b-4281-b951-d872f2087c98
parent 202e490e
......@@ -13607,9 +13607,6 @@ After you create a new supervised user, you can manage their settings at any tim
Launch app
</message>
</if>
<message name="IDS_USER_MANAGER_SCREEN_TITLE" desc="String to be displayed in the title bar of the user manager page">
User Manager
</message>
<message name="IDS_GO_INCOGNITO_BUTTON" desc="Text shown on Chrome OS sign-in screen button that launches guest session. Should be short.">
Browse as Guest
</message>
......
......@@ -177,3 +177,17 @@ html[dir=rtl] #slide-guests .arrow-down {
background-image: url(
'chrome://theme/IDR_ICON_USER_MANAGER_TUTORIAL_COMPLETE');
}
#slide-not-you #dismiss-bubble-button {
background-image: url('chrome://theme/IDR_CLOSE_1');
cursor: pointer;
height: 16px;
position: absolute;
right: 5px;
top: 5px;
width: 16px;
}
html[dir=rtl] #slide-not-you #dismiss-bubble-button {
left: 5px;
}
......@@ -61,6 +61,7 @@
</div>
<div class="tutorial-slide hidden" id="slide-not-you">
<div id="dismiss-bubble-button"></div>
<div class="slide-buttons">
<div class="slide-text" i18n-content="slideCompleteUserNotFound"></div>
<button id="slide-add-user" class="link-button"
......
......@@ -72,9 +72,15 @@ cr.define('cr.ui.login', function() {
handleAddUserClick_: function(e) {
chrome.send('addUser');
$('user-manager-tutorial').hidden = true;
// Prevent further propagation of click event. Otherwise, the click event
// handler of document object will set wallpaper to user's wallpaper when
// there is only one existing user. See http://crbug.com/166477
e.stopPropagation();
},
/**
* Add a button click handler to dismiss the last tutorial bubble.
* @private
*/
handleDismissBubbleClick_: function(e) {
$('user-manager-tutorial').hidden = true;
e.stopPropagation();
},
......@@ -94,6 +100,8 @@ cr.define('cr.ui.login', function() {
}
$('slide-add-user').addEventListener('click',
this.handleAddUserClick_.bind(this));
$('dismiss-bubble-button').addEventListener('click',
this.handleDismissBubbleClick_.bind(this));
}
};
......
......@@ -13,7 +13,7 @@
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "grit/generated_resources.h"
#include "grit/chromium_strings.h"
#include "ui/base/l10n/l10n_util_mac.h"
// Default window size. Taken from the views implementation in
......@@ -108,7 +108,7 @@ class UserManagerWebContentsDelegate : public content::WebContentsDelegate {
NSResizableWindowMask
backing:NSBackingStoreBuffered
defer:NO];
[window setTitle:l10n_util::GetNSString(IDS_USER_MANAGER_SCREEN_TITLE)];
[window setTitle:l10n_util::GetNSString(IDS_PRODUCT_NAME)];
[window setMinSize:NSMakeSize(kWindowWidth, kWindowHeight)];
if ((self = [super initWithWindow:window])) {
......
......@@ -14,7 +14,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/views/auto_keep_alive.h"
#include "content/public/browser/web_contents.h"
#include "grit/generated_resources.h"
#include "grit/chromium_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/layout/fill_layout.h"
......@@ -151,7 +151,7 @@ bool UserManagerView::CanMaximize() const {
}
base::string16 UserManagerView::GetWindowTitle() const {
return l10n_util::GetStringUTF16(IDS_USER_MANAGER_SCREEN_TITLE);
return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
}
int UserManagerView::GetDialogButtons() const {
......
......@@ -498,7 +498,7 @@ void UserManagerScreenHandler::GetLocalizedValues(
localized_strings->SetString("screenType", "login-add-user");
localized_strings->SetString("highlightStrength", "normal");
localized_strings->SetString("title",
l10n_util::GetStringUTF16(IDS_USER_MANAGER_SCREEN_TITLE));
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
localized_strings->SetString("passwordHint",
l10n_util::GetStringUTF16(IDS_LOGIN_POD_EMPTY_PASSWORD_TEXT));
localized_strings->SetString("podMenuButtonAccessibleName",
......
......@@ -13,7 +13,7 @@
#include "components/signin/core/common/profile_management_switches.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
#include "grit/generated_resources.h"
#include "grit/chromium_strings.h"
#include "ui/base/l10n/l10n_util.h"
class UserManagerUIBrowserTest : public InProcessBrowserTest,
......@@ -39,7 +39,7 @@ IN_PROC_BROWSER_TEST_F(UserManagerUIBrowserTest, PageLoads) {
browser()->tab_strip_model()->GetActiveWebContents();
base::string16 title = web_contents->GetTitle();
EXPECT_EQ(l10n_util::GetStringUTF16(IDS_USER_MANAGER_SCREEN_TITLE), title);
EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), title);
// If the page has loaded correctly, then there should be an account picker.
int num_account_pickers = -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment