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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 1737413002: Modified the behavior of "Hide Toolbar in Full Screen" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "chrome/browser/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 430
431 profile_pref_registrar_.Init(profile_->GetPrefs()); 431 profile_pref_registrar_.Init(profile_->GetPrefs());
432 profile_pref_registrar_.Add( 432 profile_pref_registrar_.Add(
433 prefs::kDevToolsDisabled, 433 prefs::kDevToolsDisabled,
434 base::Bind(&Browser::OnDevToolsDisabledChanged, base::Unretained(this))); 434 base::Bind(&Browser::OnDevToolsDisabledChanged, base::Unretained(this)));
435 profile_pref_registrar_.Add( 435 profile_pref_registrar_.Add(
436 bookmarks::prefs::kShowBookmarkBar, 436 bookmarks::prefs::kShowBookmarkBar,
437 base::Bind(&Browser::UpdateBookmarkBarState, base::Unretained(this), 437 base::Bind(&Browser::UpdateBookmarkBarState, base::Unretained(this),
438 BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE)); 438 BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE));
439 439
440 #if defined(OS_MACOSX)
441 // Migrate the value of kHideFullscreenToolbar to kShowFullscreenToolbar if
msw 2016/03/01 19:23:02 I think this belongs in MigrateObsoleteProfilePref
spqchan 2016/03/01 23:41:31 Sounds good! I moved the code into MigrateObsolete
442 // it was set by the user. See crbug.com/590827.
443 PrefService* prefs = profile_->GetPrefs();
444 const PrefService::Preference* hide_pref =
445 prefs->FindPreference(prefs::kHideFullscreenToolbar);
446 if (!hide_pref->IsDefaultValue()) {
447 bool hide_pref_value = prefs->GetBoolean(prefs::kHideFullscreenToolbar);
448 prefs->SetBoolean(prefs::kShowFullscreenToolbar, !hide_pref_value);
449 prefs->ClearPref(prefs::kHideFullscreenToolbar);
450 }
451 #endif
452
440 // NOTE: These prefs all need to be explicitly destroyed in the destructor 453 // NOTE: These prefs all need to be explicitly destroyed in the destructor
441 // or you'll get a nasty surprise when you run the incognito tests. 454 // or you'll get a nasty surprise when you run the incognito tests.
442 encoding_auto_detect_.Init(prefs::kWebKitUsesUniversalDetector, 455 encoding_auto_detect_.Init(prefs::kWebKitUsesUniversalDetector,
443 profile_->GetPrefs()); 456 profile_->GetPrefs());
444 457
445 if (search::IsInstantExtendedAPIEnabled() && is_type_tabbed()) 458 if (search::IsInstantExtendedAPIEnabled() && is_type_tabbed())
446 instant_controller_.reset(new BrowserInstantController(this)); 459 instant_controller_.reset(new BrowserInstantController(this));
447 460
448 if (extensions::HostedAppBrowserController::IsForHostedApp(this)) { 461 if (extensions::HostedAppBrowserController::IsForHostedApp(this)) {
449 hosted_app_controller_.reset( 462 hosted_app_controller_.reset(
(...skipping 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2734 if (contents && !allow_js_access) { 2747 if (contents && !allow_js_access) {
2735 contents->web_contents()->GetController().LoadURL( 2748 contents->web_contents()->GetController().LoadURL(
2736 target_url, 2749 target_url,
2737 content::Referrer(), 2750 content::Referrer(),
2738 ui::PAGE_TRANSITION_LINK, 2751 ui::PAGE_TRANSITION_LINK,
2739 std::string()); // No extra headers. 2752 std::string()); // No extra headers.
2740 } 2753 }
2741 2754
2742 return contents != NULL; 2755 return contents != NULL;
2743 } 2756 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698