OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CHROME_SHELL_CONTENT_STATE_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_CHROME_SHELL_CONTENT_STATE_H_ |
6 #define CHROME_BROWSER_UI_ASH_CHROME_SHELL_CONTENT_STATE_H_ | 6 #define CHROME_BROWSER_UI_ASH_CHROME_SHELL_CONTENT_STATE_H_ |
7 | 7 |
8 #include "ash/content/shell_content_state.h" | 8 #include "ash/content/shell_content_state.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 | 10 |
11 class ChromeShellContentState : public ash::ShellContentState { | 11 class ChromeShellContentState : public ash::ShellContentState { |
12 public: | 12 public: |
13 ChromeShellContentState(); | 13 ChromeShellContentState(); |
14 ~ChromeShellContentState() override; | |
14 | 15 |
15 private: | 16 static void SetInstance(ChromeShellContentState* state); |
James Cook
2017/01/09 21:07:19
Do you use these public methods outside this class
riajiang
2017/01/09 23:46:51
It's not used outside. Moved it to ctor and dtor.
| |
16 ~ChromeShellContentState() override; | 17 static ChromeShellContentState* GetInstance(); |
18 static void DestroyInstance(); | |
17 | 19 |
18 // Overridden from ash::ShellContentState: | 20 // Overridden from ash::ShellContentState: |
19 content::BrowserContext* GetActiveBrowserContext() override; | 21 content::BrowserContext* GetActiveBrowserContext() override; |
20 content::BrowserContext* GetBrowserContextByIndex( | 22 content::BrowserContext* GetBrowserContextByIndex( |
21 ash::UserIndex index) override; | 23 ash::UserIndex index) override; |
22 content::BrowserContext* GetBrowserContextForWindow( | 24 content::BrowserContext* GetBrowserContextForWindow( |
23 aura::Window* window) override; | 25 aura::Window* window) override; |
24 content::BrowserContext* GetUserPresentingBrowserContextForWindow( | 26 content::BrowserContext* GetUserPresentingBrowserContextForWindow( |
25 aura::Window* window) override; | 27 aura::Window* window) override; |
26 | 28 |
29 private: | |
30 static ChromeShellContentState* instance_; | |
31 | |
27 DISALLOW_COPY_AND_ASSIGN(ChromeShellContentState); | 32 DISALLOW_COPY_AND_ASSIGN(ChromeShellContentState); |
28 }; | 33 }; |
29 | 34 |
30 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_CONTENT_STATE_H_ | 35 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_CONTENT_STATE_H_ |
OLD | NEW |