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

Unified Diff: chrome/browser/extensions/extension_tabs_module.h

Issue 8373027: Prevent incognito windows from opening when incognito mode is disabled. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Pulled incognito decision logic into a separate function. Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_tabs_module.h
diff --git a/chrome/browser/extensions/extension_tabs_module.h b/chrome/browser/extensions/extension_tabs_module.h
index 6d26e6b070734de7390df0a606d35c94afc1fdad..239a6ab65d219e1c427d42c347d07155bf9f40d7 100644
--- a/chrome/browser/extensions/extension_tabs_module.h
+++ b/chrome/browser/extensions/extension_tabs_module.h
@@ -7,16 +7,22 @@
#pragma once
#include <string>
+#include <vector>
#include "base/compiler_specific.h"
#include "chrome/browser/extensions/extension_function.h"
#include "content/browser/tab_contents/tab_contents_observer.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "googleurl/src/gurl.h"
class BackingStore;
class SkBitmap;
+namespace base {
+class DictionaryValue;
+} // namespace base
+
// Windows
class GetWindowFunction : public SyncExtensionFunction {
virtual ~GetWindowFunction() {}
@@ -41,6 +47,15 @@ class GetAllWindowsFunction : public SyncExtensionFunction {
class CreateWindowFunction : public SyncExtensionFunction {
virtual ~CreateWindowFunction() {}
virtual bool RunImpl() OVERRIDE;
+ // Returns whether the window should be created in incognito mode.
+ // |urls| is the list of urls to open. If we are creating an incognito window,
+ // the function will remove these urls which may not be opened in incognito
+ // mode. If window creation leads the browser into an erroneous state,
+ // |is_error| is set to true (also, error_ member variable is assigned
+ // the proper error message).
+ bool ShouldOpenIncognitoWindow(const base::DictionaryValue* args,
+ std::vector<GURL>* urls,
+ bool* is_error);
DECLARE_EXTENSION_FUNCTION_NAME("windows.create")
};
class UpdateWindowFunction : public SyncExtensionFunction {
« no previous file with comments | « chrome/browser/extensions/extension_tabs_apitest.cc ('k') | chrome/browser/extensions/extension_tabs_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698