| 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_CORE_CONTENTS_BLIMP_CONTENTS_MANAGER_H_ | 5 #ifndef BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_MANAGER_H_ |
| 6 #define BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_MANAGER_H_ | 6 #define BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_MANAGER_H_ |
| 7 | 7 |
| 8 #include "blimp/client/core/contents/blimp_contents_impl.h" | 8 #include "blimp/client/core/contents/blimp_contents_impl.h" |
| 9 #include "ui/gfx/native_widget_types.h" |
| 9 | 10 |
| 10 namespace blimp { | 11 namespace blimp { |
| 11 namespace client { | 12 namespace client { |
| 12 | 13 |
| 13 class TabControlFeature; | 14 class TabControlFeature; |
| 14 | 15 |
| 15 // BlimpContentsManager does the real work of creating BlimpContentsImpl, and | 16 // BlimpContentsManager does the real work of creating BlimpContentsImpl, and |
| 16 // then passes the ownership to the caller. It also owns the observers to | 17 // then passes the ownership to the caller. It also owns the observers to |
| 17 // monitor the life time of the contents it creates. | 18 // monitor the life time of the contents it creates. |
| 18 class BlimpContentsManager { | 19 class BlimpContentsManager { |
| 19 public: | 20 public: |
| 20 explicit BlimpContentsManager(ImeFeature* ime_feature, | 21 explicit BlimpContentsManager(ImeFeature* ime_feature, |
| 21 NavigationFeature* nav_feature, | 22 NavigationFeature* nav_feature, |
| 22 TabControlFeature* tab_control_feature); | 23 TabControlFeature* tab_control_feature); |
| 23 ~BlimpContentsManager(); | 24 ~BlimpContentsManager(); |
| 24 | 25 |
| 25 // Builds a BlimpContentsImpl and notifies the engine. | 26 // Builds a BlimpContentsImpl and notifies the engine. |
| 26 std::unique_ptr<BlimpContentsImpl> CreateBlimpContents(); | 27 std::unique_ptr<BlimpContentsImpl> CreateBlimpContents( |
| 28 gfx::NativeWindow window); |
| 27 | 29 |
| 28 // The caller can query the contents through its id. | 30 // The caller can query the contents through its id. |
| 29 BlimpContentsImpl* GetBlimpContents(int id); | 31 BlimpContentsImpl* GetBlimpContents(int id); |
| 30 | 32 |
| 31 private: | 33 private: |
| 32 class BlimpContentsDeletionObserver; | 34 class BlimpContentsDeletionObserver; |
| 33 friend class BlimpContentsDeletionObserver; | 35 friend class BlimpContentsDeletionObserver; |
| 34 | 36 |
| 35 // When creating the BlimpContentsImpl, an id is created for the content. | 37 // When creating the BlimpContentsImpl, an id is created for the content. |
| 36 int CreateBlimpContentsId(); | 38 int CreateBlimpContentsId(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 57 | 59 |
| 58 base::WeakPtrFactory<BlimpContentsManager> weak_ptr_factory_; | 60 base::WeakPtrFactory<BlimpContentsManager> weak_ptr_factory_; |
| 59 | 61 |
| 60 DISALLOW_COPY_AND_ASSIGN(BlimpContentsManager); | 62 DISALLOW_COPY_AND_ASSIGN(BlimpContentsManager); |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 } // namespace client | 65 } // namespace client |
| 64 } // namespace blimp | 66 } // namespace blimp |
| 65 | 67 |
| 66 #endif // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_MANAGER_H_ | 68 #endif // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_MANAGER_H_ |
| OLD | NEW |