OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_OBSERVER_H_ | 5 #ifndef BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_OBSERVER_H_ |
6 #define BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_OBSERVER_H_ | 6 #define BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_OBSERVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
11 namespace blimp { | 11 namespace blimp { |
12 namespace client { | 12 namespace client { |
13 | 13 |
14 class BlimpContents; | 14 class BlimpContents; |
15 | 15 |
16 // An observer API implemented by classes which are interested in various events | 16 // An observer API implemented by classes which are interested in various events |
17 // related to BlimpContents. | 17 // related to BlimpContents. |
18 class BlimpContentsObserver { | 18 class BlimpContentsObserver { |
19 public: | 19 public: |
20 virtual ~BlimpContentsObserver(); | 20 virtual ~BlimpContentsObserver(); |
21 | 21 |
22 // Invoked when the navigation state of the BlimpContents has changed. | 22 // Invoked when the navigation state of the BlimpContents has changed. |
23 virtual void OnNavigationStateChanged() {} | 23 virtual void OnNavigationStateChanged() {} |
24 | 24 |
25 // Invoked when the BlimpContents starts or stops loading. | 25 // Invoked when the BlimpContents starts or stops loading resources. |
26 virtual void OnLoadingStateChanged(bool loading) {} | 26 virtual void OnLoadingStateChanged(bool loading) {} |
27 | 27 |
| 28 // Invoked when the BlimpContents starts or stops loading a page. |
| 29 virtual void OnPageLoadingStateChanged(bool loading) {} |
| 30 |
28 // Called by BlimpContentsDying(). | 31 // Called by BlimpContentsDying(). |
29 virtual void OnContentsDestroyed() {} | 32 virtual void OnContentsDestroyed() {} |
30 | 33 |
31 // Invoke when the destructor of blimp contents is called. This will clear | 34 // Invoke when the destructor of blimp contents is called. This will clear |
32 // the contents_ to nullptr. | 35 // the contents_ to nullptr. |
33 void BlimpContentsDying(); | 36 void BlimpContentsDying(); |
34 | 37 |
35 BlimpContents* blimp_contents() { return contents_; } | 38 BlimpContents* blimp_contents() { return contents_; } |
36 | 39 |
37 protected: | 40 protected: |
38 explicit BlimpContentsObserver(BlimpContents* blimp_contents); | 41 explicit BlimpContentsObserver(BlimpContents* blimp_contents); |
39 | 42 |
40 private: | 43 private: |
41 // The BlimpContents being tracked by this BlimpContentsObserver. | 44 // The BlimpContents being tracked by this BlimpContentsObserver. |
42 BlimpContents* contents_; | 45 BlimpContents* contents_; |
43 | 46 |
44 DISALLOW_COPY_AND_ASSIGN(BlimpContentsObserver); | 47 DISALLOW_COPY_AND_ASSIGN(BlimpContentsObserver); |
45 }; | 48 }; |
46 | 49 |
47 } // namespace client | 50 } // namespace client |
48 } // namespace blimp | 51 } // namespace blimp |
49 | 52 |
50 #endif // BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_OBSERVER_H_ | 53 #endif // BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_OBSERVER_H_ |
OLD | NEW |