| 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 <memory> | 10 #include <memory> |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 have its own shelf icon. Otherwise the window | 194 // If true, the window will have its own shelf icon. Otherwise the window |
| 195 // will be grouped in the shelf with other windows that are associated with | 195 // will be grouped in the shelf with other windows that are associated with |
| 196 // the app. Defaults to false. | 196 // the app. Defaults to false. |
| 197 bool show_in_shelf; | 197 bool show_in_shelf; |
| 198 | 198 |
| 199 // Icon URL to be used for setting the window icon. |
| 200 GURL window_icon_url; |
| 201 |
| 199 // The API enables developers to specify content or window bounds. This | 202 // The API enables developers to specify content or window bounds. This |
| 200 // function combines them into a single, constrained window size. | 203 // function combines them into a single, constrained window size. |
| 201 gfx::Rect GetInitialWindowBounds(const gfx::Insets& frame_insets) const; | 204 gfx::Rect GetInitialWindowBounds(const gfx::Insets& frame_insets) const; |
| 202 | 205 |
| 203 // The API enables developers to specify content or window size constraints. | 206 // The API enables developers to specify content or window size constraints. |
| 204 // These functions combine them so that we can work with one set of | 207 // These functions combine them so that we can work with one set of |
| 205 // constraints. | 208 // constraints. |
| 206 gfx::Size GetContentMinimumSize(const gfx::Insets& frame_insets) const; | 209 gfx::Size GetContentMinimumSize(const gfx::Insets& frame_insets) const; |
| 207 gfx::Size GetContentMaximumSize(const gfx::Insets& frame_insets) const; | 210 gfx::Size GetContentMaximumSize(const gfx::Insets& frame_insets) const; |
| 208 gfx::Size GetWindowMinimumSize(const gfx::Insets& frame_insets) const; | 211 gfx::Size GetWindowMinimumSize(const gfx::Insets& frame_insets) const; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 bool requested_alpha_enabled() const { return requested_alpha_enabled_; } | 371 bool requested_alpha_enabled() const { return requested_alpha_enabled_; } |
| 369 | 372 |
| 370 // Whether the app window is created by IME extensions. | 373 // Whether the app window is created by IME extensions. |
| 371 // TODO(bshe): rename to hide_app_window_in_launcher if it is not used | 374 // TODO(bshe): rename to hide_app_window_in_launcher if it is not used |
| 372 // anywhere other than app_window_launcher_controller after M45. Otherwise, | 375 // anywhere other than app_window_launcher_controller after M45. Otherwise, |
| 373 // remove this TODO. | 376 // remove this TODO. |
| 374 bool is_ime_window() const { return is_ime_window_; } | 377 bool is_ime_window() const { return is_ime_window_; } |
| 375 | 378 |
| 376 bool show_in_shelf() const { return show_in_shelf_; } | 379 bool show_in_shelf() const { return show_in_shelf_; } |
| 377 | 380 |
| 381 const GURL& window_icon_url() const { return window_icon_url_; } |
| 382 |
| 378 void SetAppWindowContentsForTesting( | 383 void SetAppWindowContentsForTesting( |
| 379 std::unique_ptr<AppWindowContents> contents) { | 384 std::unique_ptr<AppWindowContents> contents) { |
| 380 app_window_contents_ = std::move(contents); | 385 app_window_contents_ = std::move(contents); |
| 381 } | 386 } |
| 382 | 387 |
| 383 protected: | 388 protected: |
| 384 ~AppWindow() override; | 389 ~AppWindow() override; |
| 385 | 390 |
| 386 private: | 391 private: |
| 387 // PlatformAppBrowserTest needs access to web_contents() | 392 // PlatformAppBrowserTest needs access to web_contents() |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 | 578 |
| 574 // Whether |alpha_enabled| was set in the CreateParams. | 579 // Whether |alpha_enabled| was set in the CreateParams. |
| 575 bool requested_alpha_enabled_; | 580 bool requested_alpha_enabled_; |
| 576 | 581 |
| 577 // Whether |is_ime_window| was set in the CreateParams. | 582 // Whether |is_ime_window| was set in the CreateParams. |
| 578 bool is_ime_window_; | 583 bool is_ime_window_; |
| 579 | 584 |
| 580 // Whether |show_in_shelf| was set in the CreateParams. | 585 // Whether |show_in_shelf| was set in the CreateParams. |
| 581 bool show_in_shelf_; | 586 bool show_in_shelf_; |
| 582 | 587 |
| 588 // Icon URL to be used for setting the window icon. If not empty, |
| 589 // window_icon_ will be fetched and set using this URL. |
| 590 GURL window_icon_url_; |
| 591 |
| 583 // PlzNavigate: this is called when the first navigation is ready to commit. | 592 // PlzNavigate: this is called when the first navigation is ready to commit. |
| 584 base::Closure on_first_commit_callback_; | 593 base::Closure on_first_commit_callback_; |
| 585 | 594 |
| 586 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; | 595 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; |
| 587 | 596 |
| 588 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 597 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
| 589 }; | 598 }; |
| 590 | 599 |
| 591 } // namespace extensions | 600 } // namespace extensions |
| 592 | 601 |
| 593 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ | 602 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ |
| OLD | NEW |