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

Side by Side Diff: chrome/browser/extensions/browser_extension_window_controller.cc

Issue 10544023: Moving the tabs_module API into a separate directory in api/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Correcting the order of includes. Created 8 years, 6 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 (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/extension_tab_util.h" 8 #include "chrome/browser/extensions/extension_tab_util.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 #include "chrome/common/extensions/extension.h"
14 14
15 BrowserExtensionWindowController::BrowserExtensionWindowController( 15 BrowserExtensionWindowController::BrowserExtensionWindowController(
16 Browser* browser) 16 Browser* browser)
17 : ExtensionWindowController(browser->window(), browser->profile()), 17 : ExtensionWindowController(browser->window(), browser->profile()),
18 browser_(browser) { 18 browser_(browser) {
19 } 19 }
20 20
21 int BrowserExtensionWindowController::GetWindowId() const { 21 int BrowserExtensionWindowController::GetWindowId() const {
22 return static_cast<int>(browser_->session_id().id()); 22 return static_cast<int>(browser_->session_id().id());
23 } 23 }
24 24
25 namespace keys = extension_tabs_module_constants; 25 namespace keys = extensions::tabs_constants;
26 26
27 std::string BrowserExtensionWindowController::GetWindowTypeText() const { 27 std::string BrowserExtensionWindowController::GetWindowTypeText() const {
28 if (browser_->is_type_popup()) 28 if (browser_->is_type_popup())
29 return keys::kWindowTypeValuePopup; 29 return keys::kWindowTypeValuePopup;
30 if (browser_->is_type_panel()) 30 if (browser_->is_type_panel())
31 return keys::kWindowTypeValuePanel; 31 return keys::kWindowTypeValuePanel;
32 if (browser_->is_app()) 32 if (browser_->is_app())
33 return keys::kWindowTypeValueApp; 33 return keys::kWindowTypeValueApp;
34 return keys::kWindowTypeValueNormal; 34 return keys::kWindowTypeValueNormal;
35 } 35 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 Browser* BrowserExtensionWindowController::GetBrowser() const { 69 Browser* BrowserExtensionWindowController::GetBrowser() const {
70 return browser_; 70 return browser_;
71 } 71 }
72 72
73 bool BrowserExtensionWindowController::IsVisibleToExtension( 73 bool BrowserExtensionWindowController::IsVisibleToExtension(
74 const extensions::Extension* extension) const { 74 const extensions::Extension* extension) const {
75 // Platform apps can only see their own windows. 75 // Platform apps can only see their own windows.
76 // TODO(mihaip): what about non-Aura panels? 76 // TODO(mihaip): what about non-Aura panels?
77 return !extension->is_platform_app(); 77 return !extension->is_platform_app();
78 } 78 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_test.cc ('k') | chrome/browser/extensions/execute_code_in_tab_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698