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

Issue 7285027: Require a default parent to use some Views implementations on Windows. (Closed)

Created:
9 years, 5 months ago by msw
Modified:
9 years, 5 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Require a default parent to use views implementations of: -NativeTabContentsView -NativeTabContentsContainer -NativeBrowserFrame BUG=88138 TEST=No crashes on start-up with --use-pure-views. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91275

Patch Set 1 : Patch to avoid --use-pure-views startup crashes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -3 lines) Patch
M chrome/browser/ui/views/frame/browser_frame_win.cc View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
msw
I'm not sure if this is correct, but I'm following the pattern of http://codereview.chromium.org/7210037/ to ...
9 years, 5 months ago (2011-07-01 03:59:17 UTC) #1
Ben Goodger (Google)
9 years, 5 months ago (2011-07-01 05:03:39 UTC) #2
LGTM

On Thu, Jun 30, 2011 at 8:59 PM, <msw@chromium.org> wrote:

> Reviewers: saintlou, Ben Goodger (Google),
>
> Message:
> I'm not sure if this is correct, but I'm following the pattern of
>
http://codereview.chromium.**org/7210037/<http://codereview.chromium.org/7210...
workaround the crashes I'm seeing on
> start-up.
>
> Description:
> Require a default parent to use views implementations of:
> -NativeTabContentsView
> -NativeTabContentsContainer
> -NativeBrowserFrame
>
> BUG=88138
> TEST=No crashes on start-up with --use-pure-views.
>
> Please review this at
http://codereview.chromium.**org/7285027/<http://codereview.chromium.org/7285...
>
> SVN Base:
svn://svn.chromium.org/chrome/**trunk/src<http://svn.chromium.org/chrome/trunk/src>
>
> Affected files:
>  M chrome/browser/ui/views/frame/**browser_frame_win.cc
>  M chrome/browser/ui/views/tab_**contents/native_tab_contents_**
> container_win.cc
>  M chrome/browser/ui/views/tab_**contents/native_tab_contents_**
> view_win.cc
>
>
> Index: chrome/browser/ui/views/frame/**browser_frame_win.cc
> diff --git a/chrome/browser/ui/views/**frame/browser_frame_win.cc
> b/chrome/browser/ui/views/**frame/browser_frame_win.cc
> index 2b344c6663578753da3f94ceb3b0b8**5789e388f6..**
> b641f359961d9fedeec8f659397353**8ce9df50ab 100644
> --- a/chrome/browser/ui/views/**frame/browser_frame_win.cc
> +++ b/chrome/browser/ui/views/**frame/browser_frame_win.cc
> @@ -17,6 +17,7 @@
>  #include "ui/base/theme_provider.h"
>  #include "ui/gfx/font.h"
>  #include "views/screen.h"
> +#include "views/views_delegate.h"
>  #include "views/widget/native_widget_**win.h"
>  #include "views/widget/widget.h"
>  #include "views/window/non_client_view.**h"
> @@ -217,7 +218,8 @@ const gfx::Font& BrowserFrame::GetTitleFont() {
>  NativeBrowserFrame* NativeBrowserFrame::**CreateNativeBrowserFrame(
>     BrowserFrame* browser_frame,
>     BrowserView* browser_view) {
> -  if (views::Widget::IsPureViews())
> +  if (views::Widget::IsPureViews() &&
> +      views::ViewsDelegate::views_**delegate->**GetDefaultParentView())
>     return new BrowserFrameViews(browser_**frame, browser_view);
>   return new BrowserFrameWin(browser_frame, browser_view);
>  }
> Index: chrome/browser/ui/views/tab_**contents/native_tab_contents_**
> container_win.cc
> diff --git
a/chrome/browser/ui/views/tab_**contents/native_tab_contents_**container_win.cc
> b/chrome/browser/ui/views/tab_**contents/native_tab_contents_**
> container_win.cc
> index 163d59d89f17e0e020ab335263b59f**ed37f778f4..**
> eea285c1d0df501b8eae6671e7a559**f14e4b718f 100644
> --- a/chrome/browser/ui/views/tab_**contents/native_tab_contents_**
> container_win.cc
> +++ b/chrome/browser/ui/views/tab_**contents/native_tab_contents_**
> container_win.cc
> @@ -13,6 +13,7 @@
>  #include "content/browser/tab_contents/**interstitial_page.h"
>  #include "content/browser/tab_contents/**tab_contents.h"
>  #include "ui/base/accessibility/**accessible_view_state.h"
> +#include "views/views_delegate.h"
>  #include "views/focus/focus_manager.h"
>
>  //////////////////////////////**//////////////////////////////**
> ////////////////////
> @@ -157,7 +158,8 @@ gfx::NativeViewAccessible
>  // static
>  NativeTabContentsContainer* NativeTabContentsContainer::**
> CreateNativeContainer(
>     TabContentsContainer* container) {
> -  if (views::Widget::IsPureViews())
> +  if (views::Widget::IsPureViews() &&
> +      views::ViewsDelegate::views_**delegate->**GetDefaultParentView())
>     return new NativeTabContentsContainerView**s(container);
>   return new NativeTabContentsContainerWin(**container);
>  }
> Index: chrome/browser/ui/views/tab_**contents/native_tab_contents_**
> view_win.cc
> diff --git
a/chrome/browser/ui/views/tab_**contents/native_tab_contents_**view_win.cc
> b/chrome/browser/ui/views/tab_**contents/native_tab_contents_**view_win.cc
> index a1550c09775cde4998457d47bd4aed**e6d41ffb89..**
> 2ef8e425aae9b0d90d4eae898042f3**3ce922a6c2 100644
> --- a/chrome/browser/ui/views/tab_**contents/native_tab_contents_**
> view_win.cc
> +++ b/chrome/browser/ui/views/tab_**contents/native_tab_contents_**
> view_win.cc
> @@ -11,6 +11,7 @@
>  #include "chrome/browser/ui/views/tab_**contents/tab_contents_drag_**
> win.h"
>  #include "content/browser/tab_contents/**tab_contents.h"
>  #include "content/browser/tab_contents/**tab_contents_view.h"
> +#include "views/views_delegate.h"
>  #include "views/widget/widget.h"
>
>  namespace {
> @@ -342,7 +343,8 @@ bool NativeTabContentsViewWin::**ScrollZoom(int
> scroll_type) {
>  // static
>  NativeTabContentsView* NativeTabContentsView::**
> CreateNativeTabContentsView(
>     internal::**NativeTabContentsViewDelegate* delegate) {
> -  if (views::Widget::IsPureViews())
> +  if (views::Widget::IsPureViews() &&
> +      views::ViewsDelegate::views_**delegate->**GetDefaultParentView())
>     return new NativeTabContentsViewViews(**delegate);
>   return new NativeTabContentsViewWin(**delegate);
>  }
>
>
>

Powered by Google App Engine
This is Rietveld 408576698