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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 13638012: cros: Disallow opening new tab/popup in app mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index f0deebc1fa6c2bb07bcd255d448bc74a923b21ef..02599bce03b0a86aee37744c0ce9bfff5ea42d79 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -15,6 +15,7 @@
#include "base/strings/string_tokenizer.h"
#include "base/utf_string_conversions.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_process.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
@@ -538,7 +539,7 @@ std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite(
if (site.SchemeIs(chrome::kGuestScheme))
partition_id = site.spec();
- DCHECK(IsValidStoragePartitionId(browser_context,partition_id));
+ DCHECK(IsValidStoragePartitionId(browser_context, partition_id));
return partition_id;
}
@@ -1693,6 +1694,13 @@ bool ChromeContentBrowserClient::CanCreateWindow(
if (extension && !extensions::BackgroundInfo::AllowJSAccess(extension))
*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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698