Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: extensions/browser/app_window/app_window.h

Issue 1914993002: Enhance chrome.app.window API with better shelf integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + Fixes v4 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 have its own shelf icon. Otherwise the window
195 // will be grouped in the shelf with other windows that are associated with
196 // the app. Defaults to false.
197 bool show_in_shelf;
198
194 // The API enables developers to specify content or window bounds. This 199 // The API enables developers to specify content or window bounds. This
195 // function combines them into a single, constrained window size. 200 // function combines them into a single, constrained window size.
196 gfx::Rect GetInitialWindowBounds(const gfx::Insets& frame_insets) const; 201 gfx::Rect GetInitialWindowBounds(const gfx::Insets& frame_insets) const;
197 202
198 // The API enables developers to specify content or window size constraints. 203 // 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 204 // These functions combine them so that we can work with one set of
200 // constraints. 205 // constraints.
201 gfx::Size GetContentMinimumSize(const gfx::Insets& frame_insets) const; 206 gfx::Size GetContentMinimumSize(const gfx::Insets& frame_insets) const;
202 gfx::Size GetContentMaximumSize(const gfx::Insets& frame_insets) const; 207 gfx::Size GetContentMaximumSize(const gfx::Insets& frame_insets) const;
203 gfx::Size GetWindowMinimumSize(const gfx::Insets& frame_insets) const; 208 gfx::Size GetWindowMinimumSize(const gfx::Insets& frame_insets) const;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 void GetSerializedState(base::DictionaryValue* properties) const; 357 void GetSerializedState(base::DictionaryValue* properties) const;
353 358
354 // Called by the window API when events can be sent to the window for this 359 // Called by the window API when events can be sent to the window for this
355 // app. 360 // app.
356 void WindowEventsReady(); 361 void WindowEventsReady();
357 362
358 // Notifies the window's contents that the render view is ready and it can 363 // Notifies the window's contents that the render view is ready and it can
359 // unblock resource requests. 364 // unblock resource requests.
360 void NotifyRenderViewReady(); 365 void NotifyRenderViewReady();
361 366
362 // Whether the app window wants to be alpha enabled.
Reilly Grant (use Gerrit) 2016/07/06 19:53:00 Don't delete these comments as they're unrelated t
stevenjb 2016/07/07 22:55:54 I may have requested that for consistency. These v
Andra Paraschiv 2016/07/08 07:20:27 Yes, Steven, you are right regarding the request.
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.
366 // TODO(bshe): rename to hide_app_window_in_launcher if it is not used 369 // 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, 370 // anywhere other than app_window_launcher_controller after M45. Otherwise,
368 // remove this TODO. 371 // remove this TODO.
369 bool is_ime_window() const { return is_ime_window_; } 372 bool is_ime_window() const { return is_ime_window_; }
370 373
374 bool show_in_shelf() const { return show_in_shelf_; }
375
371 void SetAppWindowContentsForTesting( 376 void SetAppWindowContentsForTesting(
372 std::unique_ptr<AppWindowContents> contents) { 377 std::unique_ptr<AppWindowContents> contents) {
373 app_window_contents_ = std::move(contents); 378 app_window_contents_ = std::move(contents);
374 } 379 }
375 380
376 protected: 381 protected:
377 ~AppWindow() override; 382 ~AppWindow() override;
378 383
379 private: 384 private:
380 // PlatformAppBrowserTest needs access to web_contents() 385 // PlatformAppBrowserTest needs access to web_contents()
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 // reinstated when the window exits fullscreen and moves away from the 568 // reinstated when the window exits fullscreen and moves away from the
564 // taskbar. 569 // taskbar.
565 bool cached_always_on_top_; 570 bool cached_always_on_top_;
566 571
567 // Whether |alpha_enabled| was set in the CreateParams. 572 // Whether |alpha_enabled| was set in the CreateParams.
568 bool requested_alpha_enabled_; 573 bool requested_alpha_enabled_;
569 574
570 // Whether |is_ime_window| was set in the CreateParams. 575 // Whether |is_ime_window| was set in the CreateParams.
571 bool is_ime_window_; 576 bool is_ime_window_;
572 577
578 // Whether |show_in_shelf| was set in the CreateParams.
579 bool show_in_shelf_;
580
573 // PlzNavigate: this is called when the first navigation is ready to commit. 581 // PlzNavigate: this is called when the first navigation is ready to commit.
574 base::Closure on_first_commit_callback_; 582 base::Closure on_first_commit_callback_;
575 583
576 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; 584 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_;
577 585
578 DISALLOW_COPY_AND_ASSIGN(AppWindow); 586 DISALLOW_COPY_AND_ASSIGN(AppWindow);
579 }; 587 };
580 588
581 } // namespace extensions 589 } // namespace extensions
582 590
583 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ 591 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698