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

Side by Side Diff: chrome/browser/ui/extensions/shell_window.cc

Issue 10407035: Extension/Platform App window isolation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 7 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 | Annotate | Revision Log
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/ui/extensions/shell_window.h" 5 #include "chrome/browser/ui/extensions/shell_window.h"
6 6
7 #include "chrome/browser/extensions/extension_process_manager.h" 7 #include "chrome/browser/extensions/extension_process_manager.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/extensions/extension_window_controller.h" 9 #include "chrome/browser/extensions/extension_window_controller.h"
10 #include "chrome/browser/extensions/shell_window_registry.h" 10 #include "chrome/browser/extensions/shell_window_registry.h"
(...skipping 28 matching lines...) Expand all
39 ShellWindowController(ShellWindow* shell_window, Profile* profile); 39 ShellWindowController(ShellWindow* shell_window, Profile* profile);
40 40
41 // Overriden from ExtensionWindowController 41 // Overriden from ExtensionWindowController
42 virtual int GetWindowId() const OVERRIDE; 42 virtual int GetWindowId() const OVERRIDE;
43 virtual std::string GetWindowTypeText() const OVERRIDE; 43 virtual std::string GetWindowTypeText() const OVERRIDE;
44 virtual base::DictionaryValue* CreateWindowValueWithTabs() const OVERRIDE; 44 virtual base::DictionaryValue* CreateWindowValueWithTabs() const OVERRIDE;
45 virtual bool CanClose(Reason* reason) const OVERRIDE; 45 virtual bool CanClose(Reason* reason) const OVERRIDE;
46 virtual void SetFullscreenMode(bool is_fullscreen, 46 virtual void SetFullscreenMode(bool is_fullscreen,
47 const GURL& extension_url) const OVERRIDE; 47 const GURL& extension_url) const OVERRIDE;
48 48
49 protected:
50 virtual bool IsVisibleToExtension(const Extension* extension) const OVERRIDE;
51
49 private: 52 private:
50 ShellWindow* shell_window_; 53 ShellWindow* shell_window_;
51 54
52 DISALLOW_COPY_AND_ASSIGN(ShellWindowController); 55 DISALLOW_COPY_AND_ASSIGN(ShellWindowController);
53 }; 56 };
54 57
55 ShellWindowController::ShellWindowController( 58 ShellWindowController::ShellWindowController(
56 ShellWindow* shell_window, 59 ShellWindow* shell_window,
57 Profile* profile) 60 Profile* profile)
58 : ExtensionWindowController(shell_window, profile), 61 : ExtensionWindowController(shell_window, profile),
(...skipping 15 matching lines...) Expand all
74 77
75 bool ShellWindowController::CanClose(Reason* reason) const { 78 bool ShellWindowController::CanClose(Reason* reason) const {
76 return true; 79 return true;
77 } 80 }
78 81
79 void ShellWindowController::SetFullscreenMode(bool is_fullscreen, 82 void ShellWindowController::SetFullscreenMode(bool is_fullscreen,
80 const GURL& extension_url) const { 83 const GURL& extension_url) const {
81 // TODO(mihaip): implement 84 // TODO(mihaip): implement
82 } 85 }
83 86
87 bool ShellWindowController::IsVisibleToExtension(const Extension* extension)
88 const {
89 return shell_window_->extension() == extension;
90 }
91
84 } // namespace internal 92 } // namespace internal
85 93
86 ShellWindow* ShellWindow::Create(Profile* profile, 94 ShellWindow* ShellWindow::Create(Profile* profile,
87 const Extension* extension, 95 const Extension* extension,
88 const GURL& url) { 96 const GURL& url) {
89 // This object will delete itself when the window is closed. 97 // This object will delete itself when the window is closed.
90 return ShellWindow::CreateImpl(profile, extension, url); 98 return ShellWindow::CreateImpl(profile, extension, url);
91 } 99 }
92 100
93 ShellWindow::ShellWindow(Profile* profile, 101 ShellWindow::ShellWindow(Profile* profile,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 203 }
196 204
197 ExtensionWindowController* ShellWindow::GetExtensionWindowController() const { 205 ExtensionWindowController* ShellWindow::GetExtensionWindowController() const {
198 return extension_window_controller_.get(); 206 return extension_window_controller_.get();
199 } 207 }
200 208
201 void ShellWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) { 209 void ShellWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) {
202 extension_function_dispatcher_.Dispatch(params, 210 extension_function_dispatcher_.Dispatch(params,
203 web_contents_->GetRenderViewHost()); 211 web_contents_->GetRenderViewHost());
204 } 212 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698