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

Issue 10896: Re-do the way browser windows are shown:... (Closed)

Created:
12 years, 1 month ago by Ben Goodger (Google)
Modified:
9 years, 6 months ago
Reviewers:
sky
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Re-do the way browser windows are shown: - Remove the path from WinMain to the Browser object passing the show_command. For the Browser object, this is a problem since this value isn't portable. For the code in general it involves a lot of ugly wiring. It's completely unnecessary since the value is obtainable via GetStartupInfo. - Remove show_command plumbing from all over the place (session restore, web app launcher, etc) Change the way browser windows are constructed: - The browser constructor now takes just a type and a profile, and simply initializes the object. - Some configuration that used to be part of the constructor that was only used in one or two use cases (initial bounds, maximized state, web app name) are split into separate setters. - Window creation is split out into a separate step to be called post configuration. - Assorted static helper functions added to Browser to make construction of common types easy. - Remove Browser::Show in favor of BrowserWindow::Show - Adjust all callers to use the new helpers. Change the way ChromeViews restores window placement: - Split restored size determination from restored maximized determination. They are needed by the code at different times. Size restoration happens when the window is constructed and Window::SetInitialBounds is called. Maximized state restoration happens when the window is shown for the first time and SW_SHOWMAXIMIZED or SW_SHOWNORMAL is needed. Thus, replace WindowDelegate::RestoreWindowPosition with WindowDelegate::RestoreWindowBounds and WindowDelegate::RestoreMaximizedState. - Window::SetInitialBounds calls WindowDelegate::RestoreWindowBounds - Window::Show calls WindowDelegate::RestoreMaximizedState - Adjusts all WindowDelegate implementations that override RestoreWindowPosition to implement these new methods instead. - Move "playback/record" mode window size setting from browser_init to Browser::RestoreWindowBounds. - Provide a virtual function on Window called GetShowState that determines the default show state to be used when Window::Show is called. For most windows and dialogs this is SW_SHOWNORMAL. AeroGlassFrame/OpaqueFrame (the browser window frames) override this since they're the app's main windows to return the value provided by GetStartupInfo which gives the value from the app shortcut. http://crbug.com/3557 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=5417

Patch Set 1 #

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+529 lines, -631 lines) Patch
M base/process_util_win.cc View 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/app/chrome_dll_main.cc View 1 4 chunks +8 lines, -8 lines 0 comments Download
M chrome/app/chrome_exe_main.cc View 1 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/app/client_util.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/app/google_update_client.h View 1 1 chunk +1 line, -3 lines 0 comments Download
M chrome/app/google_update_client.cc View 1 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/automation/automation_provider.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/bookmarks/bookmark_utils.cc View 1 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/browser.h View 1 9 chunks +43 lines, -41 lines 0 comments Download
M chrome/browser/browser.cc View 1 20 chunks +144 lines, -154 lines 0 comments Download
M chrome/browser/browser_init.h View 1 6 chunks +7 lines, -17 lines 0 comments Download
M chrome/browser/browser_init.cc View 1 15 chunks +22 lines, -68 lines 0 comments Download
M chrome/browser/browser_main.cc View 1 3 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/browser_window.h View 1 3 chunks +4 lines, -10 lines 0 comments Download
M chrome/browser/profile_manager.cc View 1 1 chunk +3 lines, -6 lines 0 comments Download
M chrome/browser/session_restore.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/session_restore.cc View 1 9 chunks +11 lines, -21 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model.cc View 1 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model_unittest.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/task_manager.h View 1 1 chunk +1 line, -6 lines 0 comments Download
M chrome/browser/task_manager.cc View 1 1 chunk +2 lines, -15 lines 0 comments Download
M chrome/browser/views/bookmark_manager_view.h View 1 1 chunk +1 line, -6 lines 0 comments Download
M chrome/browser/views/bookmark_manager_view.cc View 1 1 chunk +2 lines, -15 lines 0 comments Download
M chrome/browser/views/frame/aero_glass_frame.h View 1 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/views/frame/aero_glass_frame.cc View 1 3 chunks +15 lines, -11 lines 0 comments Download
M chrome/browser/views/frame/browser_frame.h View 1 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/views/frame/browser_view.h View 1 4 chunks +11 lines, -8 lines 0 comments Download
M chrome/browser/views/frame/browser_view.cc View 1 7 chunks +50 lines, -23 lines 0 comments Download
M chrome/browser/views/frame/browser_window_factory.cc View 1 2 chunks +5 lines, -9 lines 0 comments Download
M chrome/browser/views/frame/opaque_frame.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/views/frame/opaque_frame.cc View 1 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/views/frame/opaque_non_client_view.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/views/options/advanced_contents_view.cc View 1 1 chunk +3 lines, -8 lines 0 comments Download
M chrome/browser/views/page_info_window.h View 1 1 chunk +1 line, -6 lines 0 comments Download
M chrome/browser/views/page_info_window.cc View 1 2 chunks +8 lines, -33 lines 0 comments Download
M chrome/browser/web_app_launcher.h View 1 2 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/web_app_launcher.cc View 1 2 chunks +5 lines, -10 lines 0 comments Download
M chrome/browser/window_sizer.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/plugin/plugin_main.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/renderer_main.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/views/window.h View 1 3 chunks +12 lines, -19 lines 0 comments Download
M chrome/views/window.cc View 1 6 chunks +39 lines, -83 lines 0 comments Download
M chrome/views/window_delegate.h View 1 2 chunks +23 lines, -12 lines 0 comments Download
M chrome/views/window_delegate.cc View 2 chunks +60 lines, -0 lines 1 comment Download

Messages

Total messages: 3 (0 generated)
Ben Goodger (Google)
12 years, 1 month ago (2008-11-13 21:04:37 UTC) #1
sky
http://codereview.chromium.org/10896/diff/1/33 File chrome/browser/browser.cc (right): http://codereview.chromium.org/10896/diff/1/33#newcode248 Line 248: window_ = BrowserWindow::CreateBrowserWindow(this); How about a DCHECK(!window_) here. ...
12 years, 1 month ago (2008-11-13 21:44:08 UTC) #2
sky
12 years, 1 month ago (2008-11-14 00:28:09 UTC) #3
LGTM

Nice cleanup!

http://codereview.chromium.org/10896/diff/203/136
File chrome/views/window_delegate.cc (right):

http://codereview.chromium.org/10896/diff/203/136#newcode80
Line 80: g_browser_process->local_state()->GetDictionary(window_name.c_str());
nit: 4 spaces.

Powered by Google App Engine
This is Rietveld 408576698