| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ | 5 #ifndef EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ |
| 6 #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ | 6 #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // If true, the window will be focused on creation. Defaults to true. | 184 // If true, the window will be focused on creation. Defaults to true. |
| 185 bool focused; | 185 bool focused; |
| 186 | 186 |
| 187 // If true, the window will stay on top of other windows that are not | 187 // If true, the window will stay on top of other windows that are not |
| 188 // configured to be always on top. Defaults to false. | 188 // configured to be always on top. Defaults to false. |
| 189 bool always_on_top; | 189 bool always_on_top; |
| 190 | 190 |
| 191 // If true, the window will be visible on all workspaces. Defaults to false. | 191 // If true, the window will be visible on all workspaces. Defaults to false. |
| 192 bool visible_on_all_workspaces; | 192 bool visible_on_all_workspaces; |
| 193 | 193 |
| 194 // If true, the window will be tied to its own icon in the shelf instead of |
| 195 // being folded in the menu of the parent app. Defaults to false. |
| 196 bool show_in_shelf; |
| 197 |
| 194 // The API enables developers to specify content or window bounds. This | 198 // The API enables developers to specify content or window bounds. This |
| 195 // function combines them into a single, constrained window size. | 199 // function combines them into a single, constrained window size. |
| 196 gfx::Rect GetInitialWindowBounds(const gfx::Insets& frame_insets) const; | 200 gfx::Rect GetInitialWindowBounds(const gfx::Insets& frame_insets) const; |
| 197 | 201 |
| 198 // The API enables developers to specify content or window size constraints. | 202 // The API enables developers to specify content or window size constraints. |
| 199 // These functions combine them so that we can work with one set of | 203 // These functions combine them so that we can work with one set of |
| 200 // constraints. | 204 // constraints. |
| 201 gfx::Size GetContentMinimumSize(const gfx::Insets& frame_insets) const; | 205 gfx::Size GetContentMinimumSize(const gfx::Insets& frame_insets) const; |
| 202 gfx::Size GetContentMaximumSize(const gfx::Insets& frame_insets) const; | 206 gfx::Size GetContentMaximumSize(const gfx::Insets& frame_insets) const; |
| 203 gfx::Size GetWindowMinimumSize(const gfx::Insets& frame_insets) const; | 207 gfx::Size GetWindowMinimumSize(const gfx::Insets& frame_insets) const; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 365 |
| 362 // Whether the app window wants to be alpha enabled. | 366 // Whether the app window wants to be alpha enabled. |
| 363 bool requested_alpha_enabled() const { return requested_alpha_enabled_; } | 367 bool requested_alpha_enabled() const { return requested_alpha_enabled_; } |
| 364 | 368 |
| 365 // Whether the app window is created by IME extensions. | 369 // Whether the app window is created by IME extensions. |
| 366 // TODO(bshe): rename to hide_app_window_in_launcher if it is not used | 370 // TODO(bshe): rename to hide_app_window_in_launcher if it is not used |
| 367 // anywhere other than app_window_launcher_controller after M45. Otherwise, | 371 // anywhere other than app_window_launcher_controller after M45. Otherwise, |
| 368 // remove this TODO. | 372 // remove this TODO. |
| 369 bool is_ime_window() const { return is_ime_window_; } | 373 bool is_ime_window() const { return is_ime_window_; } |
| 370 | 374 |
| 375 // Whether the app window will create its own icon in the shelf. |
| 376 bool show_in_shelf() const { return show_in_shelf_; } |
| 377 |
| 371 void SetAppWindowContentsForTesting(scoped_ptr<AppWindowContents> contents) { | 378 void SetAppWindowContentsForTesting(scoped_ptr<AppWindowContents> contents) { |
| 372 app_window_contents_ = std::move(contents); | 379 app_window_contents_ = std::move(contents); |
| 373 } | 380 } |
| 374 | 381 |
| 375 protected: | 382 protected: |
| 376 ~AppWindow() override; | 383 ~AppWindow() override; |
| 377 | 384 |
| 378 private: | 385 private: |
| 379 // PlatformAppBrowserTest needs access to web_contents() | 386 // PlatformAppBrowserTest needs access to web_contents() |
| 380 friend class PlatformAppBrowserTest; | 387 friend class PlatformAppBrowserTest; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // reinstated when the window exits fullscreen and moves away from the | 566 // reinstated when the window exits fullscreen and moves away from the |
| 560 // taskbar. | 567 // taskbar. |
| 561 bool cached_always_on_top_; | 568 bool cached_always_on_top_; |
| 562 | 569 |
| 563 // Whether |alpha_enabled| was set in the CreateParams. | 570 // Whether |alpha_enabled| was set in the CreateParams. |
| 564 bool requested_alpha_enabled_; | 571 bool requested_alpha_enabled_; |
| 565 | 572 |
| 566 // Whether |is_ime_window| was set in the CreateParams. | 573 // Whether |is_ime_window| was set in the CreateParams. |
| 567 bool is_ime_window_; | 574 bool is_ime_window_; |
| 568 | 575 |
| 576 // Whether |show_in_shelf| was set in the CreateParams. |
| 577 bool show_in_shelf_; |
| 578 |
| 569 // PlzNavigate: this is called when the first navigation is ready to commit. | 579 // PlzNavigate: this is called when the first navigation is ready to commit. |
| 570 base::Closure on_first_commit_callback_; | 580 base::Closure on_first_commit_callback_; |
| 571 | 581 |
| 572 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; | 582 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; |
| 573 | 583 |
| 574 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 584 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
| 575 }; | 585 }; |
| 576 | 586 |
| 577 } // namespace extensions | 587 } // namespace extensions |
| 578 | 588 |
| 579 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ | 589 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ |
| OLD | NEW |