Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_MODAL_DIALOG_MANAGER_COCOA_H_ | |
| 6 #define CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_MODAL_DIALOG_MANAGER_COCOA_H_ | |
| 7 | |
| 8 #include "base/mac/scoped_nsobject.h" | |
|
tapted
2015/02/26 23:34:49
nit: import
Andre
2015/03/02 02:55:56
Done.
| |
| 9 #include "base/observer_list.h" | |
| 10 #include "components/web_modal/single_web_contents_dialog_manager.h" | |
| 11 | |
| 12 @protocol ConstrainedWindowSheet; | |
| 13 | |
| 14 class WebContentsModalDialogManagerCocoa | |
|
tapted
2015/02/26 23:34:49
It's a mouthful, but perhaps prefix with 'Single'.
Andre
2015/03/02 02:55:56
Done.
| |
| 15 : public web_modal::SingleWebContentsDialogManager { | |
| 16 public: | |
| 17 WebContentsModalDialogManagerCocoa( | |
| 18 id<ConstrainedWindowSheet> sheet, | |
| 19 web_modal::SingleWebContentsDialogManagerDelegate* delegate); | |
| 20 ~WebContentsModalDialogManagerCocoa() override; | |
| 21 | |
| 22 class Observer { | |
| 23 public: | |
| 24 virtual ~Observer() {} | |
| 25 virtual void OnDialogClosing() = 0; // Called when the dialog is closing. | |
| 26 }; | |
| 27 | |
| 28 void AddObserver(Observer* observer); | |
| 29 void RemoveObserver(Observer* observer); | |
| 30 | |
| 31 // SingleWebContentsDialogManager overrides. | |
| 32 void Show() override; | |
| 33 void Hide() override; | |
| 34 void Close() override; | |
| 35 void Focus() override; | |
| 36 void Pulse() override; | |
| 37 void HostChanged(web_modal::WebContentsModalDialogHost* new_host) override; | |
| 38 web_modal::NativeWebContentsModalDialog dialog() override; | |
| 39 | |
| 40 private: | |
| 41 base::scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_; | |
| 42 // Weak. Owns this. | |
| 43 web_modal::SingleWebContentsDialogManagerDelegate* delegate_; | |
| 44 ObserverList<Observer> observers_; | |
| 45 bool shown_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogManagerCocoa); | |
| 48 }; | |
| 49 | |
| 50 #endif // CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_MODAL_DIALOG_MANAGER_COCOA_H_ | |
| OLD | NEW |