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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm

Issue 1091173005: Removed the context menu in kiosk mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable the context menu in kiosk mode 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 unified diff | Download patch
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/bookmarks/bookmark_bar_controller.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
6 6
7 #include "base/command_line.h"
7 #include "base/mac/bundle_locations.h" 8 #include "base/mac/bundle_locations.h"
8 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
10 #include "base/strings/sys_string_conversions.h" 11 #include "base/strings/sys_string_conversions.h"
11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
12 #include "chrome/browser/bookmarks/bookmark_stats.h" 13 #include "chrome/browser/bookmarks/bookmark_stats.h"
13 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" 14 #include "chrome/browser/bookmarks/chrome_bookmark_client.h"
14 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h" 15 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
15 #include "chrome/browser/prefs/incognito_mode_prefs.h" 16 #include "chrome/browser/prefs/incognito_mode_prefs.h"
16 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
(...skipping 19 matching lines...) Expand all
36 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" 37 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h"
37 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h" 38 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h"
38 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 39 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
39 #import "chrome/browser/ui/cocoa/menu_button.h" 40 #import "chrome/browser/ui/cocoa/menu_button.h"
40 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" 41 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h"
41 #import "chrome/browser/ui/cocoa/themed_window.h" 42 #import "chrome/browser/ui/cocoa/themed_window.h"
42 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" 43 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
43 #import "chrome/browser/ui/cocoa/view_id_util.h" 44 #import "chrome/browser/ui/cocoa/view_id_util.h"
44 #import "chrome/browser/ui/cocoa/view_resizer.h" 45 #import "chrome/browser/ui/cocoa/view_resizer.h"
45 #include "chrome/browser/ui/tabs/tab_strip_model.h" 46 #include "chrome/browser/ui/tabs/tab_strip_model.h"
47 #include "chrome/common/chrome_switches.h"
46 #include "chrome/common/extensions/extension_constants.h" 48 #include "chrome/common/extensions/extension_constants.h"
47 #include "chrome/common/extensions/extension_metrics.h" 49 #include "chrome/common/extensions/extension_metrics.h"
48 #include "chrome/common/pref_names.h" 50 #include "chrome/common/pref_names.h"
49 #include "chrome/common/url_constants.h" 51 #include "chrome/common/url_constants.h"
50 #include "chrome/grit/generated_resources.h" 52 #include "chrome/grit/generated_resources.h"
51 #include "components/bookmarks/browser/bookmark_model.h" 53 #include "components/bookmarks/browser/bookmark_model.h"
52 #include "components/bookmarks/browser/bookmark_node_data.h" 54 #include "components/bookmarks/browser/bookmark_node_data.h"
53 #include "components/bookmarks/browser/bookmark_utils.h" 55 #include "components/bookmarks/browser/bookmark_utils.h"
54 #include "content/public/browser/user_metrics.h" 56 #include "content/public/browser/user_metrics.h"
55 #include "content/public/browser/web_contents.h" 57 #include "content/public/browser/web_contents.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; 283 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter];
282 [defaultCenter addObserver:self 284 [defaultCenter addObserver:self
283 selector:@selector(themeDidChangeNotification:) 285 selector:@selector(themeDidChangeNotification:)
284 name:kBrowserThemeDidChangeNotification 286 name:kBrowserThemeDidChangeNotification
285 object:nil]; 287 object:nil];
286 [defaultCenter addObserver:self 288 [defaultCenter addObserver:self
287 selector:@selector(pulseBookmarkNotification:) 289 selector:@selector(pulseBookmarkNotification:)
288 name:bookmark_button::kPulseBookmarkButtonNotification 290 name:bookmark_button::kPulseBookmarkButtonNotification
289 object:nil]; 291 object:nil];
290 292
291 contextMenuController_.reset( 293 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode) ) {
Peter Kasting 2015/06/15 20:16:33 Nit: 80 columns
frederic.jacob.78 2015/06/24 18:07:52 Acknowledged.
292 [[BookmarkContextMenuCocoaController alloc] 294 contextMenuController_.reset(
293 initWithBookmarkBarController:self]); 295 [[BookmarkContextMenuCocoaController alloc]
296 initWithBookmarkBarController:self]);
297 }
294 298
295 // This call triggers an -awakeFromNib, which builds the bar, which might 299 // This call triggers an -awakeFromNib, which builds the bar, which might
296 // use |folderImage_| and |contextMenuController_|. Ensure it happens after 300 // use |folderImage_| and |contextMenuController_|. Ensure it happens after
297 // |folderImage_| is loaded and |contextMenuController_| is created. 301 // |folderImage_| is loaded and |contextMenuController_| is created.
298 [[self animatableView] setResizeDelegate:resizeDelegate]; 302 [[self animatableView] setResizeDelegate:resizeDelegate];
299 } 303 }
300 return self; 304 return self;
301 } 305 }
302 306
303 - (Browser*)browser { 307 - (Browser*)browser {
(...skipping 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after
2902 - (id<BookmarkButtonControllerProtocol>)controllerForNode: 2906 - (id<BookmarkButtonControllerProtocol>)controllerForNode:
2903 (const BookmarkNode*)node { 2907 (const BookmarkNode*)node {
2904 // See if it's in the bar, then if it is in the hierarchy of visible 2908 // See if it's in the bar, then if it is in the hierarchy of visible
2905 // folder menus. 2909 // folder menus.
2906 if (bookmarkModel_->bookmark_bar_node() == node) 2910 if (bookmarkModel_->bookmark_bar_node() == node)
2907 return self; 2911 return self;
2908 return [folderController_ controllerForNode:node]; 2912 return [folderController_ controllerForNode:node];
2909 } 2913 }
2910 2914
2911 @end 2915 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698