| 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_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 views::Widget* GetWidget() override { return View::GetWidget(); } | 194 views::Widget* GetWidget() override { return View::GetWidget(); } |
| 195 const views::Widget* GetWidget() const override { return View::GetWidget(); } | 195 const views::Widget* GetWidget() const override { return View::GetWidget(); } |
| 196 base::string16 GetWindowTitle() const override { | 196 base::string16 GetWindowTitle() const override { |
| 197 return impl_->closed_via_webui() ? base::string16() : | 197 return impl_->closed_via_webui() ? base::string16() : |
| 198 GetWebDialogDelegate()->GetDialogTitle(); | 198 GetWebDialogDelegate()->GetDialogTitle(); |
| 199 } | 199 } |
| 200 views::View* GetContentsView() override { return this; } | 200 views::View* GetContentsView() override { return this; } |
| 201 views::NonClientFrameView* CreateNonClientFrameView( | 201 views::NonClientFrameView* CreateNonClientFrameView( |
| 202 views::Widget* widget) override { | 202 views::Widget* widget) override { |
| 203 return views::DialogDelegate::CreateDialogFrameView(widget); | 203 return views::DialogDelegate::CreateDialogFrameView(widget, gfx::Insets()); |
| 204 } | 204 } |
| 205 bool ShouldShowCloseButton() const override { | 205 bool ShouldShowCloseButton() const override { |
| 206 // No close button if the dialog doesn't want a title bar. | 206 // No close button if the dialog doesn't want a title bar. |
| 207 return impl_->GetWebDialogDelegate()->ShouldShowDialogTitle(); | 207 return impl_->GetWebDialogDelegate()->ShouldShowDialogTitle(); |
| 208 } | 208 } |
| 209 ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_CHILD; } | 209 ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_CHILD; } |
| 210 | 210 |
| 211 // views::WebView: | 211 // views::WebView: |
| 212 bool AcceleratorPressed(const ui::Accelerator& accelerator) override { | 212 bool AcceleratorPressed(const ui::Accelerator& accelerator) override { |
| 213 // Pressing ESC closes the dialog. | 213 // Pressing ESC closes the dialog. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 min_size, max_size); | 300 min_size, max_size); |
| 301 | 301 |
| 302 // For embedded WebContents, use the embedder's WebContents for constrained | 302 // For embedded WebContents, use the embedder's WebContents for constrained |
| 303 // window. | 303 // window. |
| 304 content::WebContents* top_level_web_contents = | 304 content::WebContents* top_level_web_contents = |
| 305 constrained_window::GetTopLevelWebContents(web_contents); | 305 constrained_window::GetTopLevelWebContents(web_contents); |
| 306 DCHECK(top_level_web_contents); | 306 DCHECK(top_level_web_contents); |
| 307 constrained_window::CreateWebModalDialogViews(dialog, top_level_web_contents); | 307 constrained_window::CreateWebModalDialogViews(dialog, top_level_web_contents); |
| 308 return dialog; | 308 return dialog; |
| 309 } | 309 } |
| OLD | NEW |