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

Side by Side Diff: chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h

Issue 2484413002: Enhance chrome.app.window API with title property
Patch Set: Created 4 years, 1 month 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 CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 10
(...skipping 26 matching lines...) Expand all
37 ~AppWindowLauncherItemController() override; 37 ~AppWindowLauncherItemController() override;
38 38
39 void AddWindow(ui::BaseWindow* window); 39 void AddWindow(ui::BaseWindow* window);
40 void RemoveWindow(ui::BaseWindow* window); 40 void RemoveWindow(ui::BaseWindow* window);
41 41
42 void SetActiveWindow(aura::Window* window); 42 void SetActiveWindow(aura::Window* window);
43 ui::BaseWindow* GetAppWindow(aura::Window* window); 43 ui::BaseWindow* GetAppWindow(aura::Window* window);
44 44
45 const std::string& app_id() const { return app_id_; } 45 const std::string& app_id() const { return app_id_; }
46 const std::string& launch_id() const { return launch_id_; } 46 const std::string& launch_id() const { return launch_id_; }
47 const std::string& title() const { return title_; }
47 48
48 // LauncherItemController overrides: 49 // LauncherItemController overrides:
49 bool IsOpen() const override; 50 bool IsOpen() const override;
50 bool IsVisible() const override; 51 bool IsVisible() const override;
51 void Launch(ash::LaunchSource source, int event_flags) override; 52 void Launch(ash::LaunchSource source, int event_flags) override;
52 ash::ShelfItemDelegate::PerformedAction Activate( 53 ash::ShelfItemDelegate::PerformedAction Activate(
53 ash::LaunchSource source) override; 54 ash::LaunchSource source) override;
54 ChromeLauncherAppMenuItems GetApplicationList(int event_flags) override; 55 ChromeLauncherAppMenuItems GetApplicationList(int event_flags) override;
55 ash::ShelfItemDelegate::PerformedAction ItemSelected( 56 ash::ShelfItemDelegate::PerformedAction ItemSelected(
56 const ui::Event& event) override; 57 const ui::Event& event) override;
(...skipping 13 matching lines...) Expand all
70 71
71 // Activates the window at position |index|. 72 // Activates the window at position |index|.
72 void ActivateIndexedApp(size_t index); 73 void ActivateIndexedApp(size_t index);
73 74
74 const WindowList& windows() const { return windows_; } 75 const WindowList& windows() const { return windows_; }
75 76
76 protected: 77 protected:
77 AppWindowLauncherItemController(Type type, 78 AppWindowLauncherItemController(Type type,
78 const std::string& app_id, 79 const std::string& app_id,
79 const std::string& launch_id, 80 const std::string& launch_id,
81 const std::string& title,
80 ChromeLauncherController* controller); 82 ChromeLauncherController* controller);
81 83
82 // Called when app window is removed from controller. 84 // Called when app window is removed from controller.
83 virtual void OnWindowRemoved(ui::BaseWindow* window) {} 85 virtual void OnWindowRemoved(ui::BaseWindow* window) {}
84 86
85 // Returns the action performed. Should be one of kNoAction, 87 // Returns the action performed. Should be one of kNoAction,
86 // kExistingWindowActivated, or kExistingWindowMinimized. 88 // kExistingWindowActivated, or kExistingWindowMinimized.
87 ash::ShelfItemDelegate::PerformedAction ShowAndActivateOrMinimize( 89 ash::ShelfItemDelegate::PerformedAction ShowAndActivateOrMinimize(
88 ui::BaseWindow* window); 90 ui::BaseWindow* window);
89 91
(...skipping 14 matching lines...) Expand all
104 ui::BaseWindow* last_active_window_ = nullptr; 106 ui::BaseWindow* last_active_window_ = nullptr;
105 107
106 // The application id associated with this set of windows. 108 // The application id associated with this set of windows.
107 const std::string app_id_; 109 const std::string app_id_;
108 110
109 // An id that can be passed to an app when launched in order to support 111 // An id that can be passed to an app when launched in order to support
110 // multiple shelf items per app. This id is used together with the app_id to 112 // multiple shelf items per app. This id is used together with the app_id to
111 // uniquely identify each shelf item that has the same app_id. 113 // uniquely identify each shelf item that has the same app_id.
112 const std::string launch_id_; 114 const std::string launch_id_;
113 115
116 // Title of the window that has its own icon in the shelf.
117 const std::string title_;
118
114 // Scoped list of observed windows (for removal on destruction) 119 // Scoped list of observed windows (for removal on destruction)
115 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; 120 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_;
116 121
117 DISALLOW_COPY_AND_ASSIGN(AppWindowLauncherItemController); 122 DISALLOW_COPY_AND_ASSIGN(AppWindowLauncherItemController);
118 }; 123 };
119 124
120 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ 125 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698