Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / app_list / app_list_shower.h
blobf03d3bed26c8e8489735d1df597b424676139651
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.
5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SHOWER_H_
6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SHOWER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/ui/app_list/app_list.h"
10 #include "chrome/browser/ui/app_list/app_list_factory.h"
11 #include "chrome/browser/ui/app_list/keep_alive_service.h"
12 #include "ui/app_list/pagination_model.h"
13 #include "ui/gfx/native_widget_types.h"
15 class Profile;
17 namespace app_list {
18 class AppListModel;
21 // Creates and shows an AppList as needed for non-Ash desktops. It is owned
22 // by AppListService.
23 class AppListShower {
24 public:
25 AppListShower(scoped_ptr<AppListFactory> factory,
26 scoped_ptr<KeepAliveService> keep_alive,
27 AppListService* service);
28 ~AppListShower();
30 void set_can_close(bool can_close) {
31 can_close_app_list_ = can_close;
34 void ShowAndReacquireFocus(Profile* requested_profile);
35 void ShowForProfile(Profile* requested_profile);
36 gfx::NativeWindow GetWindow();
38 AppList* app_list() { return app_list_.get(); }
39 Profile* profile() const { return profile_; }
41 // Create or recreate, and initialize |app_list_| from |requested_profile|.
42 void CreateViewForProfile(Profile* requested_profile);
44 void DismissAppList();
45 void CloseAppList();
46 bool IsAppListVisible() const;
47 void WarmupForProfile(Profile* profile);
48 bool HasView() const;
50 private:
51 scoped_ptr<AppListFactory> factory_;
52 scoped_ptr<KeepAliveService> keep_alive_service_;
53 scoped_ptr<AppList> app_list_;
54 AppListService* service_; // Weak ptr, owns this.
55 Profile* profile_;
56 bool can_close_app_list_;
58 // Used to keep the browser process alive while the app list is visible.
60 DISALLOW_COPY_AND_ASSIGN(AppListShower);
63 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SHOWER_H_