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

Side by Side Diff: chrome/browser/ui/app_list/app_list_shower_views.h

Issue 2582743002: Remove obsolete app_list Linux code. (Closed)
Patch Set: tapted comments. Created 4 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SHOWER_VIEWS_H_
6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SHOWER_VIEWS_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "ui/gfx/native_widget_types.h"
12
13 namespace app_list {
14 class AppListView;
15 }
16
17 class AppListShowerDelegate;
18 class AppListShowerUnitTest;
19 class Profile;
20 class ScopedKeepAlive;
21
22 // Creates and shows an AppList as needed for non-Ash desktops. It is owned by
23 // AppListServiceViews.
24 class AppListShower {
25 public:
26 explicit AppListShower(AppListShowerDelegate* delegate);
27 virtual ~AppListShower();
28
29 void ShowForCurrentProfile();
30 gfx::NativeWindow GetWindow();
31
32 app_list::AppListView* app_list() { return app_list_; }
33 Profile* profile() const { return profile_; }
34
35 // Create or recreate, and initialize |app_list_| from |requested_profile|.
36 void CreateViewForProfile(Profile* requested_profile);
37
38 void DismissAppList();
39
40 // Virtual functions mocked out in tests.
41 virtual void HandleViewBeingDestroyed();
42 virtual bool IsAppListVisible() const;
43 virtual bool HasView() const;
44
45 protected:
46 virtual app_list::AppListView* MakeViewForCurrentProfile();
47 virtual void UpdateViewForNewProfile();
48
49 // Shows the app list, activates it, and ensures the taskbar icon is updated.
50 virtual void Show();
51 virtual void Hide();
52
53 private:
54 friend class ::AppListShowerUnitTest;
55
56 void ResetKeepAliveSoon();
57 void ResetKeepAlive();
58
59 AppListShowerDelegate* delegate_; // Weak. Owns this.
60
61 // The profile currently shown by |app_list_|.
62 Profile* profile_;
63
64 // The view, once created. Owned by native widget.
65 app_list::AppListView* app_list_;
66
67 // Used to keep the browser process alive while the app list is visible.
68 std::unique_ptr<ScopedKeepAlive> keep_alive_;
69
70 bool window_icon_updated_;
71
72 DISALLOW_COPY_AND_ASSIGN(AppListShower);
73 };
74
75 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SHOWER_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698