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

Issue 5976005: show notification on locale change (Closed)

Created:
10 years ago by Denis Lagno
Modified:
9 years, 6 months ago
CC:
chromium-reviews, nkostylev+cc_chromium.org, davemoore+watch_chromium.org, brettw-cc_chromium.org, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

For ChromeOS: when starting session: if locale was changed (as a result of sync or because user preference differs from login locale): show notification. BUG=chromium-os:9164 TEST=Manual Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=71320

Patch Set 1 : format #

Patch Set 2 : iterate #

Patch Set 3 : removed dead code #

Patch Set 4 : tweak #

Patch Set 5 : ifdef,rebase #

Patch Set 6 : includes removed #

Patch Set 7 : tweak #

Patch Set 8 : rename #

Patch Set 9 : siplification+rebase+year #

Patch Set 10 : year #

Total comments: 19

Patch Set 11 : infobar -> SystemNotification #

Total comments: 43

Patch Set 12 : for test #

Patch Set 13 : reworked how locale change is accepted #

Patch Set 14 : ifdef #

Total comments: 2

Patch Set 15 : comment #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+378 lines, -69 lines) Patch
M chrome/app/generated_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/dom_ui/language_options_handler.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -13 lines 0 comments Download
A chrome/browser/chromeos/locale_change_guard.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +61 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/locale_change_guard.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +134 lines, -0 lines 2 comments Download
M chrome/browser/chromeos/login/login_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +45 lines, -18 lines 0 comments Download
M chrome/browser/chromeos/notifications/system_notification.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +11 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/notifications/system_notification.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +24 lines, -6 lines 0 comments Download
M chrome/browser/notifications/notification_ui_manager.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/profiles/profile.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/profiles/profile.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +24 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/infobar_delegate.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +10 lines, -4 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +14 lines, -12 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -1 line 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -2 lines 0 comments Download
M chrome/test/testing_profile.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/tools/chromeactions.txt View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Denis Lagno
please take a look: glen@ for locale-related behaviour brettw@ for TabContents/InfoBar interaction nkostylev@ overall check
10 years ago (2010-12-24 16:03:36 UTC) #1
Glen Murphy
As per the other thread, we should not be using infobars for this sort of ...
10 years ago (2010-12-24 16:07:07 UTC) #2
Glen Murphy
Oh, I didn't notice that you said you'd add system-wide notifications later. OK, but if ...
10 years ago (2010-12-24 16:16:37 UTC) #3
Denis Lagno
Are system-wide notifications specific for ChromeOS? Could you point me some place in chromium source ...
10 years ago (2010-12-24 16:20:19 UTC) #4
Denis Lagno
Need to proceed. Nikita is on vacation. Replacing by Anton.
9 years, 11 months ago (2011-01-10 19:12:24 UTC) #5
Glen Murphy
+johnnyg,oshima, who can talk about how the notifications API can be used.
9 years, 11 months ago (2011-01-10 19:21:39 UTC) #6
whywhat
Do we need to do what we consider wrong already? Do we need infobar even ...
9 years, 11 months ago (2011-01-11 10:24:14 UTC) #7
Denis Lagno
On 2011/01/11 10:24:14, whywhat wrote: > Do we need to do what we consider wrong ...
9 years, 11 months ago (2011-01-11 11:45:12 UTC) #8
Denis Lagno
Glen, let's make sure that we are on the same board. Do you suggest using ...
9 years, 11 months ago (2011-01-11 18:54:21 UTC) #9
John Gregg
On 2011/01/11 18:54:21, Denis Lagno wrote: > Glen, let's make sure that we are on ...
9 years, 11 months ago (2011-01-11 18:55:17 UTC) #10
oshima
On Tue, Jan 11, 2011 at 10:55 AM, <johnnyg@chromium.org> wrote: > On 2011/01/11 18:54:21, Denis ...
9 years, 11 months ago (2011-01-11 19:15:24 UTC) #11
Denis Lagno
please take a look again http://codereview.chromium.org/5976005/diff/48001/chrome/browser/chromeos/login/login_utils.cc File chrome/browser/chromeos/login/login_utils.cc (right): http://codereview.chromium.org/5976005/diff/48001/chrome/browser/chromeos/login/login_utils.cc#newcode333 chrome/browser/chromeos/login/login_utils.cc:333: std::string pref_locale = On ...
9 years, 11 months ago (2011-01-12 15:33:27 UTC) #12
whywhat
http://codereview.chromium.org/5976005/diff/60001/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): http://codereview.chromium.org/5976005/diff/60001/chrome/app/generated_resources.grd#newcode4338 chrome/app/generated_resources.grd:4338: <!-- Locale Changed Info Bar--> Not an Info Bar ...
9 years, 11 months ago (2011-01-12 16:33:16 UTC) #13
Denis Lagno
http://codereview.chromium.org/5976005/diff/60001/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): http://codereview.chromium.org/5976005/diff/60001/chrome/app/generated_resources.grd#newcode4338 chrome/app/generated_resources.grd:4338: <!-- Locale Changed Info Bar--> On 2011/01/12 16:33:16, whywhat ...
9 years, 11 months ago (2011-01-12 20:27:34 UTC) #14
oshima
LGTM on system notification bits. http://codereview.chromium.org/5976005/diff/75001/chrome/browser/chromeos/locale_change_guard.h File chrome/browser/chromeos/locale_change_guard.h (right): http://codereview.chromium.org/5976005/diff/75001/chrome/browser/chromeos/locale_change_guard.h#newcode20 chrome/browser/chromeos/locale_change_guard.h:20: class LocaleChangeGuard { description ...
9 years, 11 months ago (2011-01-12 21:11:53 UTC) #15
whywhat
LGTM! http://codereview.chromium.org/5976005/diff/60001/chrome/browser/chromeos/locale_change_guard.cc File chrome/browser/chromeos/locale_change_guard.cc (right): http://codereview.chromium.org/5976005/diff/60001/chrome/browser/chromeos/locale_change_guard.cc#newcode132 chrome/browser/chromeos/locale_change_guard.cc:132: void LocaleChangeGuard::Check(TabContents* tab_contents) { On 2011/01/12 20:27:34, Denis ...
9 years, 11 months ago (2011-01-13 10:09:43 UTC) #16
Denis Lagno
> Yet, you don't fear to change the code itself like you know it, right? ...
9 years, 11 months ago (2011-01-13 10:46:44 UTC) #17
brettw
http://codereview.chromium.org/5976005/diff/81001/chrome/browser/chromeos/locale_change_guard.cc File chrome/browser/chromeos/locale_change_guard.cc (right): http://codereview.chromium.org/5976005/diff/81001/chrome/browser/chromeos/locale_change_guard.cc#newcode62 chrome/browser/chromeos/locale_change_guard.cc:62: std::string cur_locale = g_browser_process->GetApplicationLocale(); I find the functions here ...
9 years, 11 months ago (2011-01-13 18:28:07 UTC) #18
Denis Lagno
9 years, 11 months ago (2011-01-17 14:39:41 UTC) #19
http://codereview.chromium.org/5976005/diff/81001/chrome/browser/chromeos/loc...
File chrome/browser/chromeos/locale_change_guard.cc (right):

http://codereview.chromium.org/5976005/diff/81001/chrome/browser/chromeos/loc...
chrome/browser/chromeos/locale_change_guard.cc:62: std::string cur_locale =
g_browser_process->GetApplicationLocale();
On 2011/01/13 18:28:07, brettw wrote:
> I find the functions here quite hard to follow since they're just a mass of
> code. Typically we would group code into a related block with a blank line
> separating them and some kind of comment to make it easier to jump to what you
> care about.
> 
> In this function, you're setting some class state interspersed with a whole
lot
> of early returns. It's not obvious that there's any ordering to this and I'm
> left wondering what the state of the object should be after one of the early
> returns. Can this also be better organized and documented?
> 
> In this particular case, you're checking the cur_locale against empty, but
under
> what cases might it be empty? It looks like it's never supposed to be empty,
and
> the BrowserProcess even has a DHCECK for this. If something weird will happen
in
> an "impossible case" then maybe there should be an assertion. In this case, I
> suspect the function might even "not do something crazy" if the locale is
empty.

I've created separate CL to attempt to address this:
http://codereview.chromium.org/6249009/

Powered by Google App Engine
This is Rietveld 408576698