OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/extensions/browser_extension_window_controller.h" | 5 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_tab_util.h" | 7 #include "chrome/browser/extensions/extension_tab_util.h" |
8 #include "chrome/browser/extensions/extension_tabs_module_constants.h" | 8 #include "chrome/browser/extensions/extension_tabs_module_constants.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sessions/session_id.h" | 10 #include "chrome/browser/sessions/session_id.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
| 13 #include "chrome/common/extensions/extension.h" |
13 | 14 |
14 BrowserExtensionWindowController::BrowserExtensionWindowController( | 15 BrowserExtensionWindowController::BrowserExtensionWindowController( |
15 Browser* browser) | 16 Browser* browser) |
16 : ExtensionWindowController(browser->window(), browser->profile()), | 17 : ExtensionWindowController(browser->window(), browser->profile()), |
17 browser_(browser) { | 18 browser_(browser) { |
18 } | 19 } |
19 | 20 |
20 int BrowserExtensionWindowController::GetWindowId() const { | 21 int BrowserExtensionWindowController::GetWindowId() const { |
21 return static_cast<int>(browser_->session_id().id()); | 22 return static_cast<int>(browser_->session_id().id()); |
22 } | 23 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 void BrowserExtensionWindowController::SetFullscreenMode( | 62 void BrowserExtensionWindowController::SetFullscreenMode( |
62 bool is_fullscreen, | 63 bool is_fullscreen, |
63 const GURL& extension_url) const { | 64 const GURL& extension_url) const { |
64 if (browser_->window()->IsFullscreen() != is_fullscreen) | 65 if (browser_->window()->IsFullscreen() != is_fullscreen) |
65 browser_->ToggleFullscreenModeWithExtension(extension_url); | 66 browser_->ToggleFullscreenModeWithExtension(extension_url); |
66 } | 67 } |
67 | 68 |
68 Browser* BrowserExtensionWindowController::GetBrowser() const { | 69 Browser* BrowserExtensionWindowController::GetBrowser() const { |
69 return browser_; | 70 return browser_; |
70 } | 71 } |
| 72 |
| 73 bool BrowserExtensionWindowController::IsVisibleToExtension( |
| 74 const extensions::Extension* extension) const { |
| 75 // Platform apps can only see their own windows. |
| 76 // TODO(mihaip): what about non-Aura panels? |
| 77 return !extension->is_platform_app(); |
| 78 } |
OLD | NEW |