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

Unified Diff: chrome/browser/chrome_browser_application_mac.mm

Issue 1091173005: Removed the context menu in kiosk mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change Cocoa codes and fix style problems after reviews" Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_browser_application_mac.mm
diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm
index e648774a16a5bc68567109486ab69b097578272b..1e4289c8dcccedb5b54067283df518be5cfc332f 100644
--- a/chrome/browser/chrome_browser_application_mac.mm
+++ b/chrome/browser/chrome_browser_application_mac.mm
@@ -5,6 +5,7 @@
#import "chrome/browser/chrome_browser_application_mac.h"
#import "base/auto_reset.h"
+#include "base/command_line.h"
#include "base/debug/crash_logging.h"
#include "base/debug/stack_trace.h"
#import "base/logging.h"
@@ -17,6 +18,7 @@
#import "base/strings/sys_string_conversions.h"
#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/crash_keys.h"
#import "chrome/common/mac/objc_zombie.h"
#include "content/public/browser/browser_accessibility_state.h"
@@ -487,8 +489,17 @@ void SwizzleInit() {
tracked_objects::ScopedTracker tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"463272 -[BrowserCrApplication sendEvent:] Mouse"));
- base::mac::ScopedSendingEvent sendingEventScoper;
- [super sendEvent:event];
+ const base::CommandLine* command_line =
Robert Sesek 2015/06/24 18:36:12 nit: blank line before
Robert Sesek 2015/06/24 18:36:12 naming: commandLine
frederic.jacob.78 2015/06/24 21:35:03 Acknowledged.
frederic.jacob.78 2015/06/24 21:35:03 Done.
+ base::CommandLine::ForCurrentProcess();
+ const bool kioskMode = command_line->HasSwitch(switches::kKioskMode);
Peter Kasting 2015/06/24 20:40:56 Nit: Personally I think the explosion of temps her
frederic.jacob.78 2015/06/24 21:35:03 I finally changed the code to only use the isLeftM
+ const bool isRightMouseMenu = (event.type == NSRightMouseDown);
+ const bool isLeftMouseMenu = (event.type == NSLeftMouseDown) &&
+ ([event modifierFlags] & NSControlKeyMask);
+
+ if (!kioskMode || (!isRightMouseMenu && !isLeftMouseMenu)) {
Robert Sesek 2015/06/24 18:36:12 Leave a comment as to why this is here.
frederic.jacob.78 2015/06/24 21:35:03 Done.
+ base::mac::ScopedSendingEvent sendingEventScoper;
+ [super sendEvent:event];
+ }
break;
}

Powered by Google App Engine
This is Rietveld 408576698