| 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 <map> |   8 #include <map> | 
|   9  |   9  | 
|  10 #include "base/memory/weak_ptr.h" |  10 #include "base/memory/weak_ptr.h" | 
 |  11 #include "blimp/client/core/contents/blimp_contents_impl.h" | 
 |  12 #include "ui/gfx/native_widget_types.h" | 
|  11  |  13  | 
|  12 namespace blimp { |  14 namespace blimp { | 
|  13 namespace client { |  15 namespace client { | 
|  14  |  16  | 
|  15 class BlimpCompositorDependencies; |  17 class BlimpCompositorDependencies; | 
|  16 class BlimpContents; |  18 class BlimpContents; | 
|  17 class BlimpContentsImpl; |  19 class BlimpContentsImpl; | 
|  18 class ImeFeature; |  20 class ImeFeature; | 
|  19 class NavigationFeature; |  21 class NavigationFeature; | 
|  20 class RenderWidgetFeature; |  22 class RenderWidgetFeature; | 
|  21 class TabControlFeature; |  23 class TabControlFeature; | 
|  22  |  24  | 
|  23 // BlimpContentsManager does the real work of creating BlimpContentsImpl, and |  25 // BlimpContentsManager does the real work of creating BlimpContentsImpl, and | 
|  24 // then passes the ownership to the caller. It also owns the observers to |  26 // then passes the ownership to the caller. It also owns the observers to | 
|  25 // monitor the life time of the contents it creates. |  27 // monitor the life time of the contents it creates. | 
|  26 class BlimpContentsManager { |  28 class BlimpContentsManager { | 
|  27  public: |  29  public: | 
|  28   explicit BlimpContentsManager( |  30   explicit BlimpContentsManager( | 
|  29       BlimpCompositorDependencies* blimp_compositor_dependencies, |  31       BlimpCompositorDependencies* blimp_compositor_dependencies, | 
|  30       ImeFeature* ime_feature, |  32       ImeFeature* ime_feature, | 
|  31       NavigationFeature* nav_feature, |  33       NavigationFeature* nav_feature, | 
|  32       RenderWidgetFeature* render_widget_feature, |  34       RenderWidgetFeature* render_widget_feature, | 
|  33       TabControlFeature* tab_control_feature); |  35       TabControlFeature* tab_control_feature); | 
|  34   ~BlimpContentsManager(); |  36   ~BlimpContentsManager(); | 
|  35  |  37  | 
|  36   // Builds a BlimpContentsImpl and notifies the engine. |  38   // Builds a BlimpContentsImpl and notifies the engine. | 
|  37   // TODO(mlliu): Currently we want to have a single BlimpContents. If there is |  39   // TODO(mlliu): Currently we want to have a single BlimpContents. If there is | 
|  38   // an existing contents, return nullptr (http://crbug.com/642558). |  40   // an existing contents, return nullptr (http://crbug.com/642558). | 
|  39   std::unique_ptr<BlimpContentsImpl> CreateBlimpContents(); |  41   std::unique_ptr<BlimpContentsImpl> CreateBlimpContents( | 
 |  42       gfx::NativeWindow window); | 
|  40  |  43  | 
|  41   // The caller can query the contents through its id. |  44   // The caller can query the contents through its id. | 
|  42   BlimpContentsImpl* GetBlimpContents(int id); |  45   BlimpContentsImpl* GetBlimpContents(int id); | 
|  43  |  46  | 
|  44  private: |  47  private: | 
|  45   class BlimpContentsDeletionObserver; |  48   class BlimpContentsDeletionObserver; | 
|  46   friend class BlimpContentsDeletionObserver; |  49   friend class BlimpContentsDeletionObserver; | 
|  47  |  50  | 
|  48   // When creating the BlimpContentsImpl, an id is created for the content. |  51   // When creating the BlimpContentsImpl, an id is created for the content. | 
|  49   int CreateBlimpContentsId(); |  52   int CreateBlimpContentsId(); | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
|  76  |  79  | 
|  77   base::WeakPtrFactory<BlimpContentsManager> weak_ptr_factory_; |  80   base::WeakPtrFactory<BlimpContentsManager> weak_ptr_factory_; | 
|  78  |  81  | 
|  79   DISALLOW_COPY_AND_ASSIGN(BlimpContentsManager); |  82   DISALLOW_COPY_AND_ASSIGN(BlimpContentsManager); | 
|  80 }; |  83 }; | 
|  81  |  84  | 
|  82 }  // namespace client |  85 }  // namespace client | 
|  83 }  // namespace blimp |  86 }  // namespace blimp | 
|  84  |  87  | 
|  85 #endif  // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_MANAGER_H_ |  88 #endif  // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_MANAGER_H_ | 
| OLD | NEW |