| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1455 bool Browser::SupportsWindowFeatureImpl(WindowFeature feature, | 1455 bool Browser::SupportsWindowFeatureImpl(WindowFeature feature, |
| 1456 bool check_fullscreen) const { | 1456 bool check_fullscreen) const { |
| 1457 // On Mac, fullscreen mode has most normal things (in a slide-down panel). On | 1457 // On Mac, fullscreen mode has most normal things (in a slide-down panel). On |
| 1458 // other platforms, we hide some controls when in fullscreen mode. | 1458 // other platforms, we hide some controls when in fullscreen mode. |
| 1459 bool hide_ui_for_fullscreen = false; | 1459 bool hide_ui_for_fullscreen = false; |
| 1460 #if !defined(OS_MACOSX) | 1460 #if !defined(OS_MACOSX) |
| 1461 hide_ui_for_fullscreen = check_fullscreen && window_ && | 1461 hide_ui_for_fullscreen = check_fullscreen && window_ && |
| 1462 window_->IsFullscreen(); | 1462 window_->IsFullscreen(); |
| 1463 #endif | 1463 #endif |
| 1464 | 1464 |
| 1465 unsigned int features = FEATURE_INFOBAR | FEATURE_SIDEBAR; | 1465 unsigned int features = FEATURE_INFOBAR; |
| 1466 | 1466 |
| 1467 #if !defined(OS_CHROMEOS) || defined(USE_AURA) | 1467 #if !defined(OS_CHROMEOS) || defined(USE_AURA) |
| 1468 // Chrome OS opens a FileBrowse pop up instead of using download shelf. | 1468 // Chrome OS opens a FileBrowse pop up instead of using download shelf. |
| 1469 // So FEATURE_DOWNLOADSHELF is only added for non-chromeos platforms. | 1469 // So FEATURE_DOWNLOADSHELF is only added for non-chromeos platforms. |
| 1470 features |= FEATURE_DOWNLOADSHELF; | 1470 features |= FEATURE_DOWNLOADSHELF; |
| 1471 #endif // !defined(OS_CHROMEOS) || defined(USE_AURA) | 1471 #endif // !defined(OS_CHROMEOS) || defined(USE_AURA) |
| 1472 | 1472 |
| 1473 if (is_type_tabbed()) | 1473 if (is_type_tabbed()) |
| 1474 features |= FEATURE_BOOKMARKBAR; | 1474 features |= FEATURE_BOOKMARKBAR; |
| 1475 | 1475 |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2337 prefs->FindPreference(prefs::kHomePageIsNewTabPage); | 2337 prefs->FindPreference(prefs::kHomePageIsNewTabPage); |
| 2338 if (home_page_is_new_tab_page_pref && | 2338 if (home_page_is_new_tab_page_pref && |
| 2339 !home_page_is_new_tab_page_pref->IsManaged() && | 2339 !home_page_is_new_tab_page_pref->IsManaged() && |
| 2340 !prefs->HasPrefPath(prefs::kHomePageIsNewTabPage)) | 2340 !prefs->HasPrefPath(prefs::kHomePageIsNewTabPage)) |
| 2341 prefs->SetBoolean(prefs::kHomePageIsNewTabPage, false); | 2341 prefs->SetBoolean(prefs::kHomePageIsNewTabPage, false); |
| 2342 } | 2342 } |
| 2343 | 2343 |
| 2344 // static | 2344 // static |
| 2345 void Browser::RegisterPrefs(PrefService* prefs) { | 2345 void Browser::RegisterPrefs(PrefService* prefs) { |
| 2346 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); | 2346 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); |
| 2347 prefs->RegisterIntegerPref(prefs::kExtensionSidebarWidth, -1); | |
| 2348 prefs->RegisterBooleanPref(prefs::kAllowFileSelectionDialogs, true); | 2347 prefs->RegisterBooleanPref(prefs::kAllowFileSelectionDialogs, true); |
| 2349 prefs->RegisterBooleanPref(prefs::kShouldShowFirstRunBubble, false); | 2348 prefs->RegisterBooleanPref(prefs::kShouldShowFirstRunBubble, false); |
| 2350 } | 2349 } |
| 2351 | 2350 |
| 2352 // static | 2351 // static |
| 2353 void Browser::RegisterUserPrefs(PrefService* prefs) { | 2352 void Browser::RegisterUserPrefs(PrefService* prefs) { |
| 2354 prefs->RegisterStringPref(prefs::kHomePage, | 2353 prefs->RegisterStringPref(prefs::kHomePage, |
| 2355 chrome::kChromeUINewTabURL, | 2354 chrome::kChromeUINewTabURL, |
| 2356 PrefService::SYNCABLE_PREF); | 2355 PrefService::SYNCABLE_PREF); |
| 2357 prefs->RegisterBooleanPref(prefs::kHomePageChanged, | 2356 prefs->RegisterBooleanPref(prefs::kHomePageChanged, |
| (...skipping 2998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5356 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5355 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
| 5357 } else { | 5356 } else { |
| 5358 GlobalErrorService* service = | 5357 GlobalErrorService* service = |
| 5359 GlobalErrorServiceFactory::GetForProfile(profile()); | 5358 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5360 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5359 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5361 if (error) { | 5360 if (error) { |
| 5362 error->ShowBubbleView(this); | 5361 error->ShowBubbleView(this); |
| 5363 } | 5362 } |
| 5364 } | 5363 } |
| 5365 } | 5364 } |
| OLD | NEW |