| 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/api/tabs/tabs_constants.h" | 7 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| 8 #include "chrome/browser/extensions/extension_tab_util.h" | 8 #include "chrome/browser/extensions/extension_tab_util.h" |
| 9 #include "chrome/browser/extensions/window_controller_list.h" | 9 #include "chrome/browser/extensions/window_controller_list.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 int BrowserExtensionWindowController::GetWindowId() const { | 28 int BrowserExtensionWindowController::GetWindowId() const { |
| 29 return static_cast<int>(browser_->session_id().id()); | 29 return static_cast<int>(browser_->session_id().id()); |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace keys = extensions::tabs_constants; | 32 namespace keys = extensions::tabs_constants; |
| 33 | 33 |
| 34 std::string BrowserExtensionWindowController::GetWindowTypeText() const { | 34 std::string BrowserExtensionWindowController::GetWindowTypeText() const { |
| 35 if (browser_->is_type_popup()) | 35 if (browser_->is_type_popup()) |
| 36 return keys::kWindowTypeValuePopup; | 36 return keys::kWindowTypeValuePopup; |
| 37 if (browser_->is_type_panel()) | |
| 38 return keys::kWindowTypeValuePanel; | |
| 39 if (browser_->is_app()) | 37 if (browser_->is_app()) |
| 40 return keys::kWindowTypeValueApp; | 38 return keys::kWindowTypeValueApp; |
| 41 return keys::kWindowTypeValueNormal; | 39 return keys::kWindowTypeValueNormal; |
| 42 } | 40 } |
| 43 | 41 |
| 44 base::DictionaryValue* | 42 base::DictionaryValue* |
| 45 BrowserExtensionWindowController::CreateWindowValue() const { | 43 BrowserExtensionWindowController::CreateWindowValue() const { |
| 46 DictionaryValue* result = extensions::WindowController::CreateWindowValue(); | 44 DictionaryValue* result = extensions::WindowController::CreateWindowValue(); |
| 47 return result; | 45 return result; |
| 48 } | 46 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 83 |
| 86 Browser* BrowserExtensionWindowController::GetBrowser() const { | 84 Browser* BrowserExtensionWindowController::GetBrowser() const { |
| 87 return browser_; | 85 return browser_; |
| 88 } | 86 } |
| 89 | 87 |
| 90 bool BrowserExtensionWindowController::IsVisibleToExtension( | 88 bool BrowserExtensionWindowController::IsVisibleToExtension( |
| 91 const extensions::Extension* extension) const { | 89 const extensions::Extension* extension) const { |
| 92 // Platform apps can only see their own windows. | 90 // Platform apps can only see their own windows. |
| 93 return !extension->is_platform_app(); | 91 return !extension->is_platform_app(); |
| 94 } | 92 } |
| OLD | NEW |