Commit 056efdce authored by xiyuan@chromium.org's avatar xiyuan@chromium.org

cros: Disallow opening new tab/popup in app mode.

BUG=178469


Review URL: https://chromiumcodereview.appspot.com/13638012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192663 0039d316-1c4b-4281-b951-d872f2087c98
parent d82d769c
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "base/strings/string_tokenizer.h" #include "base/strings/string_tokenizer.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "chrome/app/breakpad_mac.h" #include "chrome/app/breakpad_mac.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
#include "chrome/browser/browser_about_handler.h" #include "chrome/browser/browser_about_handler.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h" #include "chrome/browser/browsing_data/browsing_data_helper.h"
...@@ -568,7 +569,7 @@ std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite( ...@@ -568,7 +569,7 @@ std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite(
if (site.SchemeIs(chrome::kGuestScheme)) if (site.SchemeIs(chrome::kGuestScheme))
partition_id = site.spec(); partition_id = site.spec();
DCHECK(IsValidStoragePartitionId(browser_context,partition_id)); DCHECK(IsValidStoragePartitionId(browser_context, partition_id));
return partition_id; return partition_id;
} }
...@@ -1725,6 +1726,13 @@ bool ChromeContentBrowserClient::CanCreateWindow( ...@@ -1725,6 +1726,13 @@ bool ChromeContentBrowserClient::CanCreateWindow(
if (extension && !extensions::BackgroundInfo::AllowJSAccess(extension)) if (extension && !extensions::BackgroundInfo::AllowJSAccess(extension))
*no_javascript_access = true; *no_javascript_access = true;
} }
// No new browser window (popup or tab) in app mode.
if (container_type == WINDOW_CONTAINER_TYPE_NORMAL &&
chrome::IsRunningInForcedAppMode()) {
return false;
}
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment