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

Issue 63033: Refactor AppModalDialogQueue and move JS Alert boxes into a MVC. (Closed)

Created:
11 years, 8 months ago by tony
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Refactor AppModalDialogQueue and move JS Alert boxes into a MVC. JavascriptMessageBoxHandler (handles alert, confirm, prompt, and onbeforeunload) was a views class. This change converts it into an MVC so we can port to linux/mac. AppModalDialog is the model+controller, JavascriptMessageBoxDialog is the windows specific view. The onbeforeunload dialog (JavascriptBeforeUnloadHandler) was a subclass of JavascriptMessageBoxHandler that had a different title and button text. I merged this class into JavascriptMessageBoxHandler by passing a bool to handle the custom button text.

Patch Set 1 #

Patch Set 2 : more refactoring #

Patch Set 3 : some more comments #

Total comments: 3

Patch Set 4 : rebase, fixes #

Patch Set 5 : views #

Patch Set 6 : whitespace #

Unified diffs Side-by-side diffs Delta from patch set Stats (+577 lines, -501 lines) Patch
A chrome/browser/app_modal_dialog.h View 1 2 3 4 1 chunk +109 lines, -0 lines 0 comments Download
A chrome/browser/app_modal_dialog.cc View 1 2 3 1 chunk +99 lines, -0 lines 0 comments Download
M chrome/browser/app_modal_dialog_queue.h View 3 chunks +8 lines, -9 lines 0 comments Download
M chrome/browser/app_modal_dialog_queue.cc View 1 2 chunks +5 lines, -7 lines 0 comments Download
A chrome/browser/app_modal_dialog_win.cc View 1 2 3 4 1 chunk +44 lines, -0 lines 0 comments Download
M chrome/browser/automation/automation_provider.cc View 1 2 3 4 chunks +6 lines, -9 lines 0 comments Download
M chrome/browser/browser.vcproj View 1 2 3 4 3 chunks +13 lines, -17 lines 0 comments Download
M chrome/browser/js_before_unload_handler.h View 1 1 chunk +0 lines, -17 lines 0 comments Download
M chrome/browser/js_before_unload_handler_win.h View 1 1 chunk +0 lines, -29 lines 0 comments Download
M chrome/browser/js_before_unload_handler_win.cc View 1 1 chunk +0 lines, -54 lines 0 comments Download
M chrome/browser/jsmessage_box_handler.h View 1 chunk +8 lines, -0 lines 0 comments Download
A chrome/browser/jsmessage_box_handler.cc View 1 chunk +79 lines, -0 lines 0 comments Download
M chrome/browser/jsmessage_box_handler_win.h View 1 2 3 4 1 chunk +0 lines, -83 lines 0 comments Download
M chrome/browser/jsmessage_box_handler_win.cc View 1 2 3 4 1 chunk +0 lines, -213 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_host/render_view_host_delegate.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/tab_contents/web_contents.h View 1 2 3 4 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/tab_contents/web_contents.cc View 1 2 3 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/views/browser_views.vcproj View 5 1 chunk +8 lines, -0 lines 0 comments Download
A chrome/browser/views/jsmessage_box_dialog.h View 1 chunk +64 lines, -0 lines 0 comments Download
A chrome/browser/views/jsmessage_box_dialog.cc View 1 chunk +122 lines, -0 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 4 chunks +6 lines, -6 lines 0 comments Download
M chrome/common/temp_scaffolding_stubs.cc View 1 chunk +0 lines, -19 lines 0 comments Download
M chrome/views/views.vcproj View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/views/window/app_modal_dialog_delegate.h View 1 chunk +0 lines, -24 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
tony
11 years, 8 months ago (2009-04-07 01:35:36 UTC) #1
Ben Goodger (Google)
OK http://codereview.chromium.org/63033/diff/1002/70 File chrome/browser/app_modal_dialog.cc (right): http://codereview.chromium.org/63033/diff/1002/70#newcode38 Line 38: bool web_contents_gone = false; This variable name ...
11 years, 8 months ago (2009-04-07 03:09:08 UTC) #2
tony
11 years, 8 months ago (2009-04-07 18:55:02 UTC) #3
On 2009/04/07 03:09:08, Ben Goodger wrote:
> OK
> 
> http://codereview.chromium.org/63033/diff/1002/70
> File chrome/browser/app_modal_dialog.cc (right):
> 
> http://codereview.chromium.org/63033/diff/1002/70#newcode38
> Line 38: bool web_contents_gone = false;
> This variable name is slightly confusing. In one of your cases below the web
> contents isn't actually gone, it's just been navigated somewhere else. Maybe
> should_close_dialog or source_page_gone or something?

This is ACW code.  I've removed the bool and just set web_contents_ to NULL.

> http://codereview.chromium.org/63033/diff/1002/70#newcode87
> Line 87: if (web_contents()) {
> nit: sometimes you use web_contents_ and sometimes you use web_contents()

Fixed to always use web_contents_

> http://codereview.chromium.org/63033/diff/1002/82
> File chrome/browser/jsmessage_box_handler_win.cc (right):
> 
> http://codereview.chromium.org/63033/diff/1002/82#newcode79
> Line 79: if (message_box_view_->IsCheckBoxSelected() && web_contents())
> This should probably only be done in Accept? Changes to dialogs aren't usually
> applied when the dialog is canceled.

Good point.  I've moved this logic into OnAccept in the controller so we can
share this code on all platforms.

I also renamed JavascriptMessageHandlerWin to JavascriptMessageBoxDialog and
moved it into browser/views/jsmessage_box_dialog.{h,cc}.

Powered by Google App Engine
This is Rietveld 408576698