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