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

Side by Side Diff: chrome/browser/ui/apps/chrome_app_delegate.h

Issue 557833007: Remove Increment/DecrementKeepAliveCount from AppsClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 3 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 CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_
6 #define CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "content/public/browser/notification_observer.h" 10 #include "content/public/browser/notification_observer.h"
11 #include "content/public/browser/notification_registrar.h" 11 #include "content/public/browser/notification_registrar.h"
12 #include "extensions/browser/app_window/app_delegate.h" 12 #include "extensions/browser/app_window/app_delegate.h"
13 #include "ui/base/window_open_disposition.h" 13 #include "ui/base/window_open_disposition.h"
14 #include "ui/gfx/rect.h" 14 #include "ui/gfx/rect.h"
15 15
16 namespace content { 16 namespace content {
17 class BrowserContext; 17 class BrowserContext;
18 class WebContents; 18 class WebContents;
19 } 19 }
20 20
21 class ScopedKeepAlive;
22
21 class ChromeAppDelegate : public extensions::AppDelegate, 23 class ChromeAppDelegate : public extensions::AppDelegate,
22 public content::NotificationObserver { 24 public content::NotificationObserver {
23 public: 25 public:
24 ChromeAppDelegate(); 26 // Pass a ScopedKeepAlive to prevent the browser process from shutting down
27 // while this object exists.
28 explicit ChromeAppDelegate(scoped_ptr<ScopedKeepAlive> keep_alive);
25 virtual ~ChromeAppDelegate(); 29 virtual ~ChromeAppDelegate();
26 30
27 static void DisableExternalOpenForTesting(); 31 static void DisableExternalOpenForTesting();
28 32
29 private: 33 private:
30 class NewWindowContentsDelegate; 34 class NewWindowContentsDelegate;
31 35
32 // extensions::AppDelegate: 36 // extensions::AppDelegate:
33 virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE; 37 virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE;
34 virtual void ResizeWebContents(content::WebContents* web_contents, 38 virtual void ResizeWebContents(content::WebContents* web_contents,
(...skipping 29 matching lines...) Expand all
64 bool blocked) OVERRIDE; 68 bool blocked) OVERRIDE;
65 virtual bool IsWebContentsVisible( 69 virtual bool IsWebContentsVisible(
66 content::WebContents* web_contents) OVERRIDE; 70 content::WebContents* web_contents) OVERRIDE;
67 virtual void SetTerminatingCallback(const base::Closure& callback) OVERRIDE; 71 virtual void SetTerminatingCallback(const base::Closure& callback) OVERRIDE;
68 72
69 // content::NotificationObserver: 73 // content::NotificationObserver:
70 virtual void Observe(int type, 74 virtual void Observe(int type,
71 const content::NotificationSource& source, 75 const content::NotificationSource& source,
72 const content::NotificationDetails& details) OVERRIDE; 76 const content::NotificationDetails& details) OVERRIDE;
73 77
78 scoped_ptr<ScopedKeepAlive> keep_alive_;
74 scoped_ptr<NewWindowContentsDelegate> new_window_contents_delegate_; 79 scoped_ptr<NewWindowContentsDelegate> new_window_contents_delegate_;
75 base::Closure terminating_callback_; 80 base::Closure terminating_callback_;
76 content::NotificationRegistrar registrar_; 81 content::NotificationRegistrar registrar_;
77 82
78 DISALLOW_COPY_AND_ASSIGN(ChromeAppDelegate); 83 DISALLOW_COPY_AND_ASSIGN(ChromeAppDelegate);
79 }; 84 };
80 85
81 #endif // CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_ 86 #endif // CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/scoped_keep_alive.cc ('k') | chrome/browser/ui/apps/chrome_app_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698