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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_command_handler.mm

Issue 1737413002: Modified the behavior of "Hide Toolbar in Full Screen" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser_window_command_handler.h" 5 #import "chrome/browser/ui/cocoa/browser_window_command_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/foundation_util.h" 8 #import "base/mac/foundation_util.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #import "chrome/browser/app_controller_mac.h" 10 #import "chrome/browser/app_controller_mac.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // On Windows this logic happens in bookmark_bar_view.cc. This simply updates 49 // On Windows this logic happens in bookmark_bar_view.cc. This simply updates
50 // the menu item; it does not display the bookmark bar itself. 50 // the menu item; it does not display the bookmark bar itself.
51 if (tag == IDC_SHOW_BOOKMARK_BAR) { 51 if (tag == IDC_SHOW_BOOKMARK_BAR) {
52 SetToggleState(browser->window()->IsBookmarkBarVisible(), item); 52 SetToggleState(browser->window()->IsBookmarkBarVisible(), item);
53 return; 53 return;
54 } 54 }
55 55
56 if (tag == IDC_TOGGLE_FULLSCREEN_TOOLBAR) { 56 if (tag == IDC_TOGGLE_FULLSCREEN_TOOLBAR) {
57 PrefService* prefs = browser->profile()->GetPrefs(); 57 PrefService* prefs = browser->profile()->GetPrefs();
58 SetToggleState(prefs->GetBoolean(prefs::kHideFullscreenToolbar), item); 58
59 // Migrate the value of kHideFullscreenToolbar to kShowFullscreenToolbar if
msw 2016/03/01 00:08:51 Do we only migrate when the user toggles the value
spqchan 2016/03/01 17:50:18 No, this is called when the menu is created. The m
60 // it was set by the user. See crbug.com/590827.
61 const PrefService::Preference* hide_pref =
62 prefs->FindPreference(prefs::kHideFullscreenToolbar);
63 if (!hide_pref->IsDefaultValue()) {
64 bool hide_pref_value = prefs->GetBoolean(prefs::kHideFullscreenToolbar);
65 prefs->SetBoolean(prefs::kShowFullscreenToolbar, !hide_pref_value);
66 prefs->ClearPref(prefs::kHideFullscreenToolbar);
67 }
68
69 SetToggleState(prefs->GetBoolean(prefs::kShowFullscreenToolbar), item);
59 return; 70 return;
60 } 71 }
61 72
62 // Update the checked/unchecked state of items in the encoding menu. 73 // Update the checked/unchecked state of items in the encoding menu.
63 // On Windows, this logic is part of |EncodingMenuModel| in 74 // On Windows, this logic is part of |EncodingMenuModel| in
64 // browser/ui/views/toolbar_view.h. 75 // browser/ui/views/toolbar_view.h.
65 EncodingMenuController encoding_controller; 76 EncodingMenuController encoding_controller;
66 if (!encoding_controller.DoesCommandBelongToEncodingMenu(tag)) 77 if (!encoding_controller.DoesCommandBelongToEncodingMenu(tag))
67 return; 78 return;
68 79
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 // the background" in this case. 285 // the background" in this case.
275 modifierFlags &= ~NSCommandKeyMask; 286 modifierFlags &= ~NSCommandKeyMask;
276 } 287 }
277 chrome::ExecuteCommandWithDisposition( 288 chrome::ExecuteCommandWithDisposition(
278 FindBrowserForSender(sender, window), command, 289 FindBrowserForSender(sender, window), command,
279 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], 290 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent],
280 modifierFlags)); 291 modifierFlags));
281 } 292 }
282 293
283 @end 294 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698