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

Side by Side Diff: chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc

Issue 10383213: Attempt at fixing crash in constrained window used by printing. I (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
9 #include "chrome/browser/ui/views/constrained_window_views.h" 9 #include "chrome/browser/ui/views/constrained_window_views.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (!impl_->closed_via_webui()) 95 if (!impl_->closed_via_webui())
96 GetWebDialogDelegate()->OnDialogClosed(std::string()); 96 GetWebDialogDelegate()->OnDialogClosed(std::string());
97 } 97 }
98 virtual views::Widget* GetWidget() OVERRIDE { 98 virtual views::Widget* GetWidget() OVERRIDE {
99 return View::GetWidget(); 99 return View::GetWidget();
100 } 100 }
101 virtual const views::Widget* GetWidget() const OVERRIDE { 101 virtual const views::Widget* GetWidget() const OVERRIDE {
102 return View::GetWidget(); 102 return View::GetWidget();
103 } 103 }
104 virtual string16 GetWindowTitle() const OVERRIDE { 104 virtual string16 GetWindowTitle() const OVERRIDE {
105 return GetWebDialogDelegate()->GetDialogTitle(); 105 return impl_->closed_via_webui() ? string16() :
106 GetWebDialogDelegate()->GetDialogTitle();
106 } 107 }
107 virtual views::View* GetContentsView() OVERRIDE { 108 virtual views::View* GetContentsView() OVERRIDE {
108 return this; 109 return this;
109 } 110 }
110 111
111 // views::WebView overrides. 112 // views::WebView overrides.
112 virtual gfx::Size GetPreferredSize() OVERRIDE { 113 virtual gfx::Size GetPreferredSize() OVERRIDE {
113 gfx::Size size; 114 gfx::Size size;
114 GetWebDialogDelegate()->GetDialogSize(&size); 115 if (!impl_->closed_via_webui())
116 GetWebDialogDelegate()->GetDialogSize(&size);
115 return size; 117 return size;
116 } 118 }
117 119
118 private: 120 private:
119 scoped_ptr<ConstrainedWebDialogDelegateViews> impl_; 121 scoped_ptr<ConstrainedWebDialogDelegateViews> impl_;
120 122
121 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateViewViews); 123 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateViewViews);
122 }; 124 };
123 125
124 ConstrainedWebDialogDelegateViewViews::ConstrainedWebDialogDelegateViewViews( 126 ConstrainedWebDialogDelegateViewViews::ConstrainedWebDialogDelegateViewViews(
(...skipping 17 matching lines...) Expand all
142 WebDialogDelegate* delegate, 144 WebDialogDelegate* delegate,
143 WebDialogWebContentsDelegate* tab_delegate, 145 WebDialogWebContentsDelegate* tab_delegate,
144 TabContentsWrapper* container) { 146 TabContentsWrapper* container) {
145 ConstrainedWebDialogDelegateViewViews* constrained_delegate = 147 ConstrainedWebDialogDelegateViewViews* constrained_delegate =
146 new ConstrainedWebDialogDelegateViewViews(profile, delegate, tab_delegate) ; 148 new ConstrainedWebDialogDelegateViewViews(profile, delegate, tab_delegate) ;
147 ConstrainedWindow* constrained_window = 149 ConstrainedWindow* constrained_window =
148 new ConstrainedWindowViews(container, constrained_delegate); 150 new ConstrainedWindowViews(container, constrained_delegate);
149 constrained_delegate->set_window(constrained_window); 151 constrained_delegate->set_window(constrained_window);
150 return constrained_delegate; 152 return constrained_delegate;
151 } 153 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698