| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/shell_dialogs.h" | 5 #include "chrome/browser/shell_dialogs.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 virtual bool IsDialogModal() const; | 108 virtual bool IsDialogModal() const; |
| 109 virtual std::wstring GetDialogTitle() const; | 109 virtual std::wstring GetDialogTitle() const; |
| 110 virtual GURL GetDialogContentURL() const; | 110 virtual GURL GetDialogContentURL() const; |
| 111 virtual void GetDOMMessageHandlers( | 111 virtual void GetDOMMessageHandlers( |
| 112 std::vector<DOMMessageHandler*>* handlers) const; | 112 std::vector<DOMMessageHandler*>* handlers) const; |
| 113 virtual void GetDialogSize(gfx::Size* size) const; | 113 virtual void GetDialogSize(gfx::Size* size) const; |
| 114 virtual std::string GetDialogArgs() const; | 114 virtual std::string GetDialogArgs() const; |
| 115 virtual void OnDialogClosed(const std::string& json_retval); | 115 virtual void OnDialogClosed(const std::string& json_retval); |
| 116 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) { | 116 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) { |
| 117 } | 117 } |
| 118 virtual bool ShouldShowDialogTitle() const { return true; } |
| 118 | 119 |
| 119 DISALLOW_COPY_AND_ASSIGN(FileBrowseDelegate); | 120 DISALLOW_COPY_AND_ASSIGN(FileBrowseDelegate); |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 class FileBrowseDelegateHandler : public DOMMessageHandler { | 123 class FileBrowseDelegateHandler : public DOMMessageHandler { |
| 123 public: | 124 public: |
| 124 explicit FileBrowseDelegateHandler(FileBrowseDelegate* delegate); | 125 explicit FileBrowseDelegateHandler(FileBrowseDelegate* delegate); |
| 125 | 126 |
| 126 // DOMMessageHandler implementation. | 127 // DOMMessageHandler implementation. |
| 127 virtual void RegisterMessages(); | 128 virtual void RegisterMessages(); |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 // TODO(xiyuan): Change this when the infrastructure is improved. | 474 // TODO(xiyuan): Change this when the infrastructure is improved. |
| 474 HtmlDialogUIDelegate** delegate = HtmlDialogUI::GetPropertyAccessor(). | 475 HtmlDialogUIDelegate** delegate = HtmlDialogUI::GetPropertyAccessor(). |
| 475 GetProperty(dom_ui_->tab_contents()->property_bag()); | 476 GetProperty(dom_ui_->tab_contents()->property_bag()); |
| 476 HtmlDialogView* containing_view = static_cast<HtmlDialogView*>(*delegate); | 477 HtmlDialogView* containing_view = static_cast<HtmlDialogView*>(*delegate); |
| 477 DCHECK(containing_view); | 478 DCHECK(containing_view); |
| 478 | 479 |
| 479 containing_view->GetWindow()->UpdateWindowTitle(); | 480 containing_view->GetWindow()->UpdateWindowTitle(); |
| 480 containing_view->GetWindow()->GetNonClientView()->SchedulePaint(); | 481 containing_view->GetWindow()->GetNonClientView()->SchedulePaint(); |
| 481 } | 482 } |
| 482 } | 483 } |
| OLD | NEW |