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

Issue 7538010: Make BrowserWindow::CreateFindBar non-static so that it can be overridden by Panels. (Closed)

Created:
9 years, 4 months ago by jennb
Modified:
9 years, 4 months ago
CC:
chromium-reviews, dcheng, Paweł Hajdan Jr.
Visibility:
Public.

Description

Make BrowserWindow::CreateFindBar non-static so that it can be overridden by Panels. BUG=None TEST=PanelBrowserTest.FindBar Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=95897

Patch Set 1 #

Patch Set 2 : Also change TestBrowserWindow #

Total comments: 10

Patch Set 3 : Fixed for Mac panels. Jian's review feedback. #

Patch Set 4 : Fix indentation. #

Patch Set 5 : Remove underscore. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -39 lines) Patch
M chrome/browser/ui/browser.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/browser_window.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.mm View 3 chunks +12 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/browser_window_factory.mm View 2 chunks +0 lines, -15 lines 0 comments Download
M chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/gtk/browser_window_factory_gtk.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/find_bar_gtk.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/find_bar_gtk.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/panels/native_panel.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/panels/panel.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/panels/panel.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_view.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_view.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_window_cocoa.h View 1 2 2 chunks +2 lines, -0 lines 2 comments Download
M chrome/browser/ui/panels/panel_browser_window_cocoa.mm View 1 2 3 3 chunks +13 lines, -1 line 2 comments Download
M chrome/browser/ui/panels/panel_browser_window_gtk.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_window_gtk.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/panels/panel_browsertest.cc View 1 2 3 chunks +19 lines, -1 line 0 comments Download
M chrome/browser/ui/panels/panel_window_controller_cocoa.h View 1 2 2 chunks +5 lines, -0 lines 2 comments Download
M chrome/browser/ui/panels/panel_window_controller_cocoa.mm View 1 2 3 4 2 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/test/base/test_browser_window.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/base/test_browser_window.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
jennb
prasadt, jianli, dimich - could one of you take this? static BrowserWindow::CreateFindBar code cast browser->window() ...
9 years, 4 months ago (2011-07-30 01:08:29 UTC) #1
Dmitry Titov
By 'take' I think you meant 'take ownership of this patch', not 'please review it'. ...
9 years, 4 months ago (2011-08-01 18:17:06 UTC) #2
jianli
I am looking into this patch now. On Mon, Aug 1, 2011 at 11:17 AM, ...
9 years, 4 months ago (2011-08-01 18:18:46 UTC) #3
prasadt
http://codereview.chromium.org/7538010/diff/1001/chrome/browser/ui/cocoa/browser_window_factory.mm File chrome/browser/ui/cocoa/browser_window_factory.mm (left): http://codereview.chromium.org/7538010/diff/1001/chrome/browser/ui/cocoa/browser_window_factory.mm#oldcode28 chrome/browser/ui/cocoa/browser_window_factory.mm:28: static_cast<BrowserWindowCocoa*>(browser->window()); How about doing an IsPanel() check on the ...
9 years, 4 months ago (2011-08-01 18:40:22 UTC) #4
jianli
Though your proposal simplifies the logic, it does not fix the underlying bad practice which ...
9 years, 4 months ago (2011-08-01 18:48:55 UTC) #5
jianli
http://codereview.chromium.org/7538010/diff/1001/chrome/browser/ui/browser_window.h File chrome/browser/ui/browser_window.h (right): http://codereview.chromium.org/7538010/diff/1001/chrome/browser/ui/browser_window.h#newcode332 chrome/browser/ui/browser_window.h:332: virtual FindBar* CreateFindBar() = 0; It seems that we ...
9 years, 4 months ago (2011-08-01 18:52:12 UTC) #6
prasadt
lgtm If we want to do this as cleanup work, that's fine by me. On ...
9 years, 4 months ago (2011-08-01 19:42:47 UTC) #7
Dmitry Titov
a drive by (for the record): http://codereview.chromium.org/7538010/diff/1001/chrome/browser/ui/panels/panel_window_controller_cocoa.h File chrome/browser/ui/panels/panel_window_controller_cocoa.h (right): http://codereview.chromium.org/7538010/diff/1001/chrome/browser/ui/panels/panel_window_controller_cocoa.h#newcode25 chrome/browser/ui/panels/panel_window_controller_cocoa.h:25: scoped_nsobject<FindBarCocoaController> findBarCocoaController_; Why ...
9 years, 4 months ago (2011-08-01 19:57:48 UTC) #8
jennb
On 2011/08/01 19:57:48, Dmitry Titov wrote: > a drive by (for the record): > > ...
9 years, 4 months ago (2011-08-05 04:29:55 UTC) #9
jennb
Patch set 4 is the same as patch set 3 with a small indentation fix. ...
9 years, 4 months ago (2011-08-08 17:26:02 UTC) #10
Dmitry Titov
lgtm for Mac with few nits: http://codereview.chromium.org/7538010/diff/13001/chrome/browser/ui/panels/panel_browser_window_cocoa.h File chrome/browser/ui/panels/panel_browser_window_cocoa.h (right): http://codereview.chromium.org/7538010/diff/13001/chrome/browser/ui/panels/panel_browser_window_cocoa.h#newcode71 chrome/browser/ui/panels/panel_browser_window_cocoa.h:71: bool has_find_bar_; // ...
9 years, 4 months ago (2011-08-08 20:08:30 UTC) #11
jianli
LGTM.
9 years, 4 months ago (2011-08-08 20:18:00 UTC) #12
jennb
9 years, 4 months ago (2011-08-08 21:21:20 UTC) #13
Will commit with the changes mentioned below after mac try job.

http://codereview.chromium.org/7538010/diff/13001/chrome/browser/ui/panels/pa...
File chrome/browser/ui/panels/panel_browser_window_cocoa.h (right):

http://codereview.chromium.org/7538010/diff/13001/chrome/browser/ui/panels/pa...
chrome/browser/ui/panels/panel_browser_window_cocoa.h:71: bool has_find_bar_; //
Find bar should only be created once per panel.
On 2011/08/08 20:08:31, Dmitry Titov wrote:
> Can we make this data member that is only used in DCHECK to be DEBUG-only?

As discussed, will not change. DCHECK is not the same as DEBUG-only. DCHECK can
be enabled for non-official release builds.

http://codereview.chromium.org/7538010/diff/13001/chrome/browser/ui/panels/pa...
File chrome/browser/ui/panels/panel_browser_window_cocoa.mm (right):

http://codereview.chromium.org/7538010/diff/13001/chrome/browser/ui/panels/pa...
chrome/browser/ui/panels/panel_browser_window_cocoa.mm:141:
DCHECK(!has_find_bar_);
On 2011/08/08 20:08:31, Dmitry Titov wrote:
> It's nice to do it this way, but I don't have a strong opinion on that:
> DCHECK(!foo) << "foo must be only teleported once";

Done.

http://codereview.chromium.org/7538010/diff/13001/chrome/browser/ui/panels/pa...
File chrome/browser/ui/panels/panel_window_controller_cocoa.h (right):

http://codereview.chromium.org/7538010/diff/13001/chrome/browser/ui/panels/pa...
chrome/browser/ui/panels/panel_window_controller_cocoa.h:43: // Retains the
given FindBarCocoaController and adds its view to this
On 2011/08/08 20:08:31, Dmitry Titov wrote:
> In the comment,  no need to say "Retains", since the code currently doesn't. 

Oops. Forgot to update that comment. Good catch. Fixed.

Powered by Google App Engine
This is Rietveld 408576698