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

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

Issue 262643003: Revert of Refactor views app list services to allow more code sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
(Empty)
1 // Copyright 2013 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 "base/memory/scoped_ptr.h"
9 #include "ui/app_list/pagination_model.h"
10 #include "ui/gfx/native_widget_types.h"
11
12 namespace app_list {
13 class AppListView;
14 }
15
16 class AppListShowerDelegate;
17 class AppListShowerUnitTest;
18 class Profile;
19 class ScopedKeepAlive;
20
21 // Creates and shows an AppList as needed for non-Ash desktops. It is owned by
22 // AppListServiceViews.
23 class AppListShower {
24 public:
25 explicit AppListShower(AppListShowerDelegate* delegate);
26 virtual ~AppListShower();
27
28 void ShowForProfile(Profile* requested_profile);
29 gfx::NativeWindow GetWindow();
30
31 app_list::AppListView* app_list() { return app_list_; }
32 Profile* profile() const { return profile_; }
33
34 // Create or recreate, and initialize |app_list_| from |requested_profile|.
35 void CreateViewForProfile(Profile* requested_profile);
36
37 void DismissAppList();
38
39 // Virtual functions mocked out in tests.
40 virtual void HandleViewBeingDestroyed();
41 virtual bool IsAppListVisible() const;
42 void WarmupForProfile(Profile* profile);
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 ResetKeepAlive();
57
58 AppListShowerDelegate* delegate_; // Weak. Owns this.
59
60 // The profile currently shown by |app_list_|.
61 Profile* profile_;
62
63 // The view, once created. Owned by native widget.
64 app_list::AppListView* app_list_;
65
66 // Used to keep the browser process alive while the app list is visible.
67 scoped_ptr<ScopedKeepAlive> keep_alive_;
68
69 bool window_icon_updated_;
70 app_list::PaginationModel pagination_model_;
71
72 DISALLOW_COPY_AND_ASSIGN(AppListShower);
73 };
74
75 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SHOWER_VIEWS_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_shower_delegate.h ('k') | chrome/browser/ui/app_list/app_list_shower_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698