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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 2346023002: Ignore Javascript urls dropped on tabs (Mac version) (Closed)
Patch Set: Address feedback Created 4 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <limits> 10 #include <limits>
(...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 // the next iteration.) 2052 // the next iteration.)
2053 i++; 2053 i++;
2054 } 2054 }
2055 2055
2056 // If we've made it here, we want to append a new tab to the end. 2056 // If we've made it here, we want to append a new tab to the end.
2057 *index = -1; 2057 *index = -1;
2058 *disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; 2058 *disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
2059 } 2059 }
2060 2060
2061 - (void)openURL:(GURL*)url inView:(NSView*)view at:(NSPoint)point { 2061 - (void)openURL:(GURL*)url inView:(NSView*)view at:(NSPoint)point {
2062 // Security: Block JavaScript to prevent self-XSS.
2063 if (url->SchemeIs(url::kJavaScriptScheme)) return;
Avi (use Gerrit) 2016/09/16 19:07:49 Strictly speaking this is allowed by the style gui
elawrence 2016/09/16 19:17:07 Done.
2064
2062 // Get the index and disposition. 2065 // Get the index and disposition.
2063 NSInteger index; 2066 NSInteger index;
2064 WindowOpenDisposition disposition; 2067 WindowOpenDisposition disposition;
2065 [self droppingURLsAt:point 2068 [self droppingURLsAt:point
2066 givesIndex:&index 2069 givesIndex:&index
2067 disposition:&disposition]; 2070 disposition:&disposition];
2068 2071
2069 // Either insert a new tab or open in a current tab. 2072 // Either insert a new tab or open in a current tab.
2070 switch (disposition) { 2073 switch (disposition) {
2071 case WindowOpenDisposition::NEW_FOREGROUND_TAB: { 2074 case WindowOpenDisposition::NEW_FOREGROUND_TAB: {
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
2333 for (int i = 0; i < tabStripModel_->count(); i++) { 2336 for (int i = 0; i < tabStripModel_->count(); i++) {
2334 [self updateIconsForContents:tabStripModel_->GetWebContentsAt(i) atIndex:i]; 2337 [self updateIconsForContents:tabStripModel_->GetWebContentsAt(i) atIndex:i];
2335 } 2338 }
2336 } 2339 }
2337 2340
2338 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen { 2341 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen {
2339 [tabStripView_ setVisualEffectsDisabledForFullscreen:fullscreen]; 2342 [tabStripView_ setVisualEffectsDisabledForFullscreen:fullscreen];
2340 } 2343 }
2341 2344
2342 @end 2345 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698