Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/html_dialog_view.h" | 5 #include "chrome/browser/ui/views/html_dialog_view.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 if (delegate_) | 170 if (delegate_) |
| 171 return delegate_->GetDialogArgs(); | 171 return delegate_->GetDialogArgs(); |
| 172 return std::string(); | 172 return std::string(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void HtmlDialogView::OnDialogClosed(const std::string& json_retval) { | 175 void HtmlDialogView::OnDialogClosed(const std::string& json_retval) { |
| 176 HtmlDialogTabContentsDelegate::Detach(); | 176 HtmlDialogTabContentsDelegate::Detach(); |
| 177 if (delegate_) { | 177 if (delegate_) { |
| 178 HtmlDialogUIDelegate* dialog_delegate = delegate_; | 178 HtmlDialogUIDelegate* dialog_delegate = delegate_; |
| 179 delegate_ = NULL; // We will not communicate further with the delegate. | 179 delegate_ = NULL; // We will not communicate further with the delegate. |
| 180 | |
| 181 // Store the dialog bounds. | |
| 182 gfx::Rect dialog_bounds = GetWidget()->GetClientAreaScreenBounds(); | |
|
yoshiki
2011/12/07 08:02:50
nit: Please add "const" modifier.
NaveenBobbili (Motorola)
2011/12/07 08:14:59
Done.
| |
| 183 dialog_delegate->StoreDialogSize(dialog_bounds); | |
| 184 | |
| 180 dialog_delegate->OnDialogClosed(json_retval); | 185 dialog_delegate->OnDialogClosed(json_retval); |
| 181 } | 186 } |
| 182 GetWidget()->Close(); | 187 GetWidget()->Close(); |
| 183 } | 188 } |
| 184 | 189 |
| 185 void HtmlDialogView::OnCloseContents(TabContents* source, | 190 void HtmlDialogView::OnCloseContents(TabContents* source, |
| 186 bool* out_close_dialog) { | 191 bool* out_close_dialog) { |
| 187 if (delegate_) | 192 if (delegate_) |
| 188 delegate_->OnCloseContents(source, out_close_dialog); | 193 delegate_->OnCloseContents(source, out_close_dialog); |
| 189 } | 194 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 268 } | 273 } |
| 269 | 274 |
| 270 void HtmlDialogView::OnTabMainFrameFirstRender() { | 275 void HtmlDialogView::OnTabMainFrameFirstRender() { |
| 271 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) | 276 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) |
| 272 if (initialized_) { | 277 if (initialized_) { |
| 273 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( | 278 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( |
| 274 GTK_WINDOW(GetWidget()->GetNativeView()), false); | 279 GTK_WINDOW(GetWidget()->GetNativeView()), false); |
| 275 } | 280 } |
| 276 #endif | 281 #endif |
| 277 } | 282 } |
| OLD | NEW |