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

Issue 9359019: Split the singleton hwnd from screen_compatible_dc_win.cc. (Closed)

Created:
8 years, 10 months ago by Alexei Svitkine (slow)
Modified:
8 years, 10 months ago
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

Split the singleton hwnd from screen_compatible_dc_win.cc. This allows different clients to register for global WM_ messages. Specifically, I plan to use this to listen for changes to the "use ClearType" system setting, which will be a separate CL. BUG=105550, 113184 TEST=none

Patch Set 1 : '' #

Total comments: 12

Patch Set 2 : '' #

Total comments: 4

Patch Set 3 : '' #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -49 lines) Patch
A ui/base/win/singleton_hwnd.h View 1 2 1 chunk +49 lines, -0 lines 0 comments Download
A ui/base/win/singleton_hwnd.cc View 1 1 chunk +84 lines, -0 lines 4 comments Download
M ui/gfx/screen_compatible_dc_win.cc View 1 2 3 chunks +25 lines, -49 lines 0 comments Download
M ui/ui.gyp View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Alexei Svitkine (slow)
8 years, 10 months ago (2012-02-08 20:04:12 UTC) #1
tfarina
http://codereview.chromium.org/9359019/diff/2002/ui/base/win/singleton_hwnd.cc File ui/base/win/singleton_hwnd.cc (right): http://codereview.chromium.org/9359019/diff/2002/ui/base/win/singleton_hwnd.cc#newcode7 ui/base/win/singleton_hwnd.cc:7: #include <vector> nit: I'd remove this include since you ...
8 years, 10 months ago (2012-02-08 20:34:55 UTC) #2
Alexei Svitkine (slow)
8 years, 10 months ago (2012-02-08 21:04:32 UTC) #3
asvitkine_google
http://codereview.chromium.org/9359019/diff/2002/ui/base/win/singleton_hwnd.cc File ui/base/win/singleton_hwnd.cc (right): http://codereview.chromium.org/9359019/diff/2002/ui/base/win/singleton_hwnd.cc#newcode7 ui/base/win/singleton_hwnd.cc:7: #include <vector> On 2012/02/08 20:34:55, tfarina wrote: > nit: ...
8 years, 10 months ago (2012-02-08 21:04:57 UTC) #4
Alexei Svitkine (slow)
From the comments on http://codereview.chromium.org/9323011/, it looks like screen_compatible_dc_win.cc might not make sense anymore... However, ...
8 years, 10 months ago (2012-02-08 22:13:29 UTC) #5
sky
LGTM http://codereview.chromium.org/9359019/diff/6002/ui/base/win/singleton_hwnd.h File ui/base/win/singleton_hwnd.h (right): http://codereview.chromium.org/9359019/diff/6002/ui/base/win/singleton_hwnd.h#newcode39 ui/base/win/singleton_hwnd.h:39: SingletonHwnd(); this should be first.
8 years, 10 months ago (2012-02-08 23:34:04 UTC) #6
sky
I'm adding Carlos to the review list, wait for him to sign off before landing.
8 years, 10 months ago (2012-02-08 23:34:28 UTC) #7
tfarina
http://codereview.chromium.org/9359019/diff/6002/ui/base/win/singleton_hwnd.h File ui/base/win/singleton_hwnd.h (right): http://codereview.chromium.org/9359019/diff/6002/ui/base/win/singleton_hwnd.h#newcode5 ui/base/win/singleton_hwnd.h:5: #ifndef UI_BASE_SINGLETON_HWND_H_ still wrong :) UI_BASE_SINGLETON_HWND_H_ -> UI_BASE_WIN_SINGLETON_HWND_H_
8 years, 10 months ago (2012-02-08 23:35:50 UTC) #8
Alexei Svitkine (slow)
http://codereview.chromium.org/9359019/diff/6002/ui/base/win/singleton_hwnd.h File ui/base/win/singleton_hwnd.h (right): http://codereview.chromium.org/9359019/diff/6002/ui/base/win/singleton_hwnd.h#newcode5 ui/base/win/singleton_hwnd.h:5: #ifndef UI_BASE_SINGLETON_HWND_H_ On 2012/02/08 23:35:50, tfarina wrote: > still ...
8 years, 10 months ago (2012-02-09 15:11:43 UTC) #9
cpu_(ooo_6.6-7.5)
I propose that you consider using chrome notifications. Chrome I believe already cares about the ...
8 years, 10 months ago (2012-02-09 21:58:37 UTC) #10
Alexei Svitkine (slow)
Since I'll be killing the screen_compatible_dc_win.cc part of this, I think I'll just close this ...
8 years, 10 months ago (2012-02-13 16:42:18 UTC) #11
Alexei Svitkine (slow)
8 years, 10 months ago (2012-02-13 23:13:55 UTC) #12
I've moved the addition of singleton_hwnd.cc to
http://codereview.chromium.org/9370026/ with some comments addressed, but
replying here..

On 2012/02/09 21:58:37, cpu wrote:
> I propose that you consider using chrome notifications. Chrome  I believe
> already cares about the main XXXX_change messages.

Do you mean the mechanism that NativeWidgetWin and friends use, i.e. this?

http://code.google.com/codesearch#search/&exact_package=chromium&q=WM_SETTING...

I didn't go with that because it's provided by ATL and last I heard, we're
trying to cut out dependencies on ATL rather than introduce new ones...

>
http://codereview.chromium.org/9359019/diff/13002/ui/base/win/singleton_hwnd.cc
> File ui/base/win/singleton_hwnd.cc (right):
> 
>
http://codereview.chromium.org/9359019/diff/13002/ui/base/win/singleton_hwnd....
> ui/base/win/singleton_hwnd.cc:16: const wchar_t kWindowClassName[] =
> L"SingletonHwnd";
> too short. How about Chrome.SigletonHwnd or Chrome_SingletonHwnd ?

Done.


> 
>
http://codereview.chromium.org/9359019/diff/13002/ui/base/win/singleton_hwnd....
> ui/base/win/singleton_hwnd.cc:24: return ::DefWindowProc(hwnd, message,
wparam,
> lparam);
> hmm, kind of weird that you can get to act on the message but not set the
return
> value. A lot of useful actions require you to return a different value from
what
> DefWindowProc requires.

The ones that this change is interested in do not need them - if they're later
needed we could expand this helper to handle that..

> 
>
http://codereview.chromium.org/9359019/diff/13002/ui/base/win/singleton_hwnd....
> ui/base/win/singleton_hwnd.cc:41: ATOM clazz = ::RegisterClassEx(&wc);
> I can smell the copy and paste :) please use var names in english, like
> window_class or win_class or whatever.

Done.

>
http://codereview.chromium.org/9359019/diff/13002/ui/base/win/singleton_hwnd....
> ui/base/win/singleton_hwnd.cc:45: hinst, 0);
> wait, this is also a message only window.. ??  you don't get broadcast
messages.

For the new use case I need, in http://codereview.chromium.org/9323011/, this is
sufficient. I've added a comment to the top of the class to mention that it's a
message only window.

Powered by Google App Engine
This is Rietveld 408576698