| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. | 199 // Icon URL to be used for setting the window icon. |
| 200 GURL window_icon_url; | 200 GURL window_icon_url; |
| 201 | 201 |
| 202 // Title of the window that has its own icon in the shelf. |
| 203 std::string title; |
| 204 |
| 202 // The API enables developers to specify content or window bounds. This | 205 // The API enables developers to specify content or window bounds. This |
| 203 // function combines them into a single, constrained window size. | 206 // function combines them into a single, constrained window size. |
| 204 gfx::Rect GetInitialWindowBounds(const gfx::Insets& frame_insets) const; | 207 gfx::Rect GetInitialWindowBounds(const gfx::Insets& frame_insets) const; |
| 205 | 208 |
| 206 // The API enables developers to specify content or window size constraints. | 209 // The API enables developers to specify content or window size constraints. |
| 207 // These functions combine them so that we can work with one set of | 210 // These functions combine them so that we can work with one set of |
| 208 // constraints. | 211 // constraints. |
| 209 gfx::Size GetContentMinimumSize(const gfx::Insets& frame_insets) const; | 212 gfx::Size GetContentMinimumSize(const gfx::Insets& frame_insets) const; |
| 210 gfx::Size GetContentMaximumSize(const gfx::Insets& frame_insets) const; | 213 gfx::Size GetContentMaximumSize(const gfx::Insets& frame_insets) const; |
| 211 gfx::Size GetWindowMinimumSize(const gfx::Insets& frame_insets) const; | 214 gfx::Size GetWindowMinimumSize(const gfx::Insets& frame_insets) const; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 // Whether the app window is created by IME extensions. | 376 // Whether the app window is created by IME extensions. |
| 374 // TODO(bshe): rename to hide_app_window_in_launcher if it is not used | 377 // TODO(bshe): rename to hide_app_window_in_launcher if it is not used |
| 375 // anywhere other than app_window_launcher_controller after M45. Otherwise, | 378 // anywhere other than app_window_launcher_controller after M45. Otherwise, |
| 376 // remove this TODO. | 379 // remove this TODO. |
| 377 bool is_ime_window() const { return is_ime_window_; } | 380 bool is_ime_window() const { return is_ime_window_; } |
| 378 | 381 |
| 379 bool show_in_shelf() const { return show_in_shelf_; } | 382 bool show_in_shelf() const { return show_in_shelf_; } |
| 380 | 383 |
| 381 const GURL& window_icon_url() const { return window_icon_url_; } | 384 const GURL& window_icon_url() const { return window_icon_url_; } |
| 382 | 385 |
| 386 const std::string& title() const { return title_; } |
| 387 |
| 383 void SetAppWindowContentsForTesting( | 388 void SetAppWindowContentsForTesting( |
| 384 std::unique_ptr<AppWindowContents> contents) { | 389 std::unique_ptr<AppWindowContents> contents) { |
| 385 app_window_contents_ = std::move(contents); | 390 app_window_contents_ = std::move(contents); |
| 386 } | 391 } |
| 387 | 392 |
| 388 protected: | 393 protected: |
| 389 ~AppWindow() override; | 394 ~AppWindow() override; |
| 390 | 395 |
| 391 private: | 396 private: |
| 392 // PlatformAppBrowserTest needs access to web_contents() | 397 // PlatformAppBrowserTest needs access to web_contents() |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 bool is_ime_window_; | 588 bool is_ime_window_; |
| 584 | 589 |
| 585 // Whether |show_in_shelf| was set in the CreateParams. | 590 // Whether |show_in_shelf| was set in the CreateParams. |
| 586 bool show_in_shelf_; | 591 bool show_in_shelf_; |
| 587 | 592 |
| 588 // Icon URL to be used for setting the window icon. If not empty, | 593 // Icon URL to be used for setting the window icon. If not empty, |
| 589 // app_icon_ will be fetched and set using this URL and will have | 594 // app_icon_ will be fetched and set using this URL and will have |
| 590 // app_icon_image_ as a badge. | 595 // app_icon_image_ as a badge. |
| 591 GURL window_icon_url_; | 596 GURL window_icon_url_; |
| 592 | 597 |
| 598 // Title of the window that has its own icon in the shelf. |
| 599 std::string title_; |
| 600 |
| 593 // PlzNavigate: this is called when the first navigation is ready to commit. | 601 // PlzNavigate: this is called when the first navigation is ready to commit. |
| 594 base::Closure on_first_commit_callback_; | 602 base::Closure on_first_commit_callback_; |
| 595 | 603 |
| 596 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; | 604 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; |
| 597 | 605 |
| 598 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 606 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
| 599 }; | 607 }; |
| 600 | 608 |
| 601 } // namespace extensions | 609 } // namespace extensions |
| 602 | 610 |
| 603 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ | 611 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ |
| OLD | NEW |