| OLD | NEW |
| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/ui/browser_dialogs.h" | 10 #include "chrome/browser/ui/browser_dialogs.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } | 207 } |
| 208 views::Widget* GetWidget() override { return View::GetWidget(); } | 208 views::Widget* GetWidget() override { return View::GetWidget(); } |
| 209 const views::Widget* GetWidget() const override { return View::GetWidget(); } | 209 const views::Widget* GetWidget() const override { return View::GetWidget(); } |
| 210 base::string16 GetWindowTitle() const override { | 210 base::string16 GetWindowTitle() const override { |
| 211 return impl_->closed_via_webui() ? base::string16() : | 211 return impl_->closed_via_webui() ? base::string16() : |
| 212 GetWebDialogDelegate()->GetDialogTitle(); | 212 GetWebDialogDelegate()->GetDialogTitle(); |
| 213 } | 213 } |
| 214 views::View* GetContentsView() override { return this; } | 214 views::View* GetContentsView() override { return this; } |
| 215 views::NonClientFrameView* CreateNonClientFrameView( | 215 views::NonClientFrameView* CreateNonClientFrameView( |
| 216 views::Widget* widget) override { | 216 views::Widget* widget) override { |
| 217 return views::DialogDelegate::CreateDialogFrameView(widget, gfx::Insets()); | 217 return views::DialogDelegate::CreateDialogFrameView(widget); |
| 218 } | 218 } |
| 219 bool ShouldShowCloseButton() const override { | 219 bool ShouldShowCloseButton() const override { |
| 220 // No close button if the dialog doesn't want a title bar. | 220 // No close button if the dialog doesn't want a title bar. |
| 221 return impl_->GetWebDialogDelegate()->ShouldShowDialogTitle(); | 221 return impl_->GetWebDialogDelegate()->ShouldShowDialogTitle(); |
| 222 } | 222 } |
| 223 ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_CHILD; } | 223 ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_CHILD; } |
| 224 | 224 |
| 225 // views::WebView: | 225 // views::WebView: |
| 226 bool AcceleratorPressed(const ui::Accelerator& accelerator) override { | 226 bool AcceleratorPressed(const ui::Accelerator& accelerator) override { |
| 227 // Pressing ESC closes the dialog. | 227 // Pressing ESC closes the dialog. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 min_size, max_size); | 314 min_size, max_size); |
| 315 | 315 |
| 316 // For embedded WebContents, use the embedder's WebContents for constrained | 316 // For embedded WebContents, use the embedder's WebContents for constrained |
| 317 // window. | 317 // window. |
| 318 content::WebContents* top_level_web_contents = | 318 content::WebContents* top_level_web_contents = |
| 319 constrained_window::GetTopLevelWebContents(web_contents); | 319 constrained_window::GetTopLevelWebContents(web_contents); |
| 320 DCHECK(top_level_web_contents); | 320 DCHECK(top_level_web_contents); |
| 321 constrained_window::CreateWebModalDialogViews(dialog, top_level_web_contents); | 321 constrained_window::CreateWebModalDialogViews(dialog, top_level_web_contents); |
| 322 return dialog; | 322 return dialog; |
| 323 } | 323 } |
| OLD | NEW |