OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_EXO_SHELL_SURFACE_H_ | 5 #ifndef COMPONENTS_EXO_SHELL_SURFACE_H_ |
6 #define COMPONENTS_EXO_SHELL_SURFACE_H_ | 6 #define COMPONENTS_EXO_SHELL_SURFACE_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <deque> | 9 #include <deque> |
10 #include <memory> | 10 #include <memory> |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 // Sets whether or not the shell surface should autohide the system UI. | 138 // Sets whether or not the shell surface should autohide the system UI. |
139 void SetSystemUiVisibility(bool autohide); | 139 void SetSystemUiVisibility(bool autohide); |
140 | 140 |
141 // Set whether the surface is always on top. | 141 // Set whether the surface is always on top. |
142 void SetAlwaysOnTop(bool always_on_top); | 142 void SetAlwaysOnTop(bool always_on_top); |
143 | 143 |
144 // Set title for surface. | 144 // Set title for surface. |
145 void SetTitle(const base::string16& title); | 145 void SetTitle(const base::string16& title); |
146 | 146 |
| 147 // Set chunk of surface icon. |
| 148 void SetIconChunk(uint32_t flags, const std::string& unsafe_icon_png); |
| 149 |
| 150 // Reset icon for surface. |
| 151 void ResetIcon(); |
| 152 |
147 // Sets the system modality. | 153 // Sets the system modality. |
148 void SetSystemModal(bool system_modal); | 154 void SetSystemModal(bool system_modal); |
149 | 155 |
150 // Sets the application ID for the window. The application ID identifies the | 156 // Sets the application ID for the window. The application ID identifies the |
151 // general class of applications to which the window belongs. | 157 // general class of applications to which the window belongs. |
152 static void SetApplicationId(aura::Window* window, const std::string& id); | 158 static void SetApplicationId(aura::Window* window, const std::string& id); |
153 static const std::string GetApplicationId(aura::Window* window); | 159 static const std::string GetApplicationId(aura::Window* window); |
154 | 160 |
155 // Set the application ID for the surface. | 161 // Set the application ID for the surface. |
156 void SetApplicationId(const std::string& application_id); | 162 void SetApplicationId(const std::string& application_id); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // Set container for surface. | 212 // Set container for surface. |
207 void SetContainer(int container); | 213 void SetContainer(int container); |
208 | 214 |
209 // Sets the main surface for the window. | 215 // Sets the main surface for the window. |
210 static void SetMainSurface(aura::Window* window, Surface* surface); | 216 static void SetMainSurface(aura::Window* window, Surface* surface); |
211 | 217 |
212 // Returns the main Surface instance or nullptr if it is not set. | 218 // Returns the main Surface instance or nullptr if it is not set. |
213 // |window| must not be nullptr. | 219 // |window| must not be nullptr. |
214 static Surface* GetMainSurface(const aura::Window* window); | 220 static Surface* GetMainSurface(const aura::Window* window); |
215 | 221 |
| 222 // Returns true if |key| defines property that contains compressed png icon |
| 223 // for a window. |
| 224 static bool IsUnsafeIconPngDataKey(const void* key); |
| 225 |
| 226 // Returns custom icon for the window in compressed png format. This data must |
| 227 // be decoded in chrome/browser context using IPC ImageDecoder. |
| 228 static const std::string* GetUnsafeIconPngData(const aura::Window* window); |
| 229 |
| 230 // Sets custom icon for the window in compressed png format. |
| 231 static void SetUnsafeIconPngData(aura::Window* window, |
| 232 std::string* unsage_icon_png_data); |
| 233 |
216 // Returns a trace value representing the state of the surface. | 234 // Returns a trace value representing the state of the surface. |
217 std::unique_ptr<base::trace_event::TracedValue> AsTracedValue() const; | 235 std::unique_ptr<base::trace_event::TracedValue> AsTracedValue() const; |
218 | 236 |
219 // Overridden from SurfaceDelegate: | 237 // Overridden from SurfaceDelegate: |
220 void OnSurfaceCommit() override; | 238 void OnSurfaceCommit() override; |
221 bool IsSurfaceSynchronized() const override; | 239 bool IsSurfaceSynchronized() const override; |
222 | 240 |
223 // Overridden from SurfaceObserver: | 241 // Overridden from SurfaceObserver: |
224 void OnSurfaceDestroying(Surface* surface) override; | 242 void OnSurfaceDestroying(Surface* surface) override; |
225 | 243 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 int64_t primary_display_id_; | 360 int64_t primary_display_id_; |
343 gfx::Point origin_; | 361 gfx::Point origin_; |
344 bool activatable_ = true; | 362 bool activatable_ = true; |
345 const bool can_minimize_; | 363 const bool can_minimize_; |
346 // Container Window Id (see ash/public/cpp/shell_window_ids.h) | 364 // Container Window Id (see ash/public/cpp/shell_window_ids.h) |
347 int container_; | 365 int container_; |
348 bool frame_enabled_ = false; | 366 bool frame_enabled_ = false; |
349 bool shadow_enabled_ = false; | 367 bool shadow_enabled_ = false; |
350 bool pending_show_widget_ = false; | 368 bool pending_show_widget_ = false; |
351 base::string16 title_; | 369 base::string16 title_; |
| 370 std::string unsafe_icon_png_; |
| 371 std::string unsafe_icon_png_builder_; |
352 std::string application_id_; | 372 std::string application_id_; |
353 gfx::Rect geometry_; | 373 gfx::Rect geometry_; |
354 gfx::Rect pending_geometry_; | 374 gfx::Rect pending_geometry_; |
355 double scale_ = 1.0; | 375 double scale_ = 1.0; |
356 double pending_scale_ = 1.0; | 376 double pending_scale_ = 1.0; |
357 base::Closure close_callback_; | 377 base::Closure close_callback_; |
358 base::Closure surface_destroyed_callback_; | 378 base::Closure surface_destroyed_callback_; |
359 StateChangedCallback state_changed_callback_; | 379 StateChangedCallback state_changed_callback_; |
360 ConfigureCallback configure_callback_; | 380 ConfigureCallback configure_callback_; |
361 ScopedConfigure* scoped_configure_ = nullptr; | 381 ScopedConfigure* scoped_configure_ = nullptr; |
(...skipping 16 matching lines...) Expand all Loading... |
378 bool shadow_underlay_in_surface_ = true; | 398 bool shadow_underlay_in_surface_ = true; |
379 bool pending_shadow_underlay_in_surface_ = true; | 399 bool pending_shadow_underlay_in_surface_ = true; |
380 bool system_modal_ = false; | 400 bool system_modal_ = false; |
381 | 401 |
382 DISALLOW_COPY_AND_ASSIGN(ShellSurface); | 402 DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
383 }; | 403 }; |
384 | 404 |
385 } // namespace exo | 405 } // namespace exo |
386 | 406 |
387 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ | 407 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |
OLD | NEW |