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/dom_ui/options/browser_options_handler.h" | 5 #include "chrome/browser/dom_ui/options/browser_options_handler.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "base/singleton.h" | 9 #include "base/singleton.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 #if defined(OS_MACOSX) | 192 #if defined(OS_MACOSX) |
193 if (ShellIntegration::SetAsDefaultBrowser()) | 193 if (ShellIntegration::SetAsDefaultBrowser()) |
194 UpdateDefaultBrowserState(); | 194 UpdateDefaultBrowserState(); |
195 #else | 195 #else |
196 default_browser_worker_->StartSetAsDefaultBrowser(); | 196 default_browser_worker_->StartSetAsDefaultBrowser(); |
197 // Callback takes care of updating UI. | 197 // Callback takes care of updating UI. |
198 #endif | 198 #endif |
199 | 199 |
200 // If the user attempted to make Chrome the default browser, then he/she | 200 // If the user attempted to make Chrome the default browser, then he/she |
201 // arguably wants to be notified when that changes. | 201 // arguably wants to be notified when that changes. |
202 PrefService* prefs = web_ui_->GetProfile()->GetPrefs(); | 202 PrefService* prefs = dom_ui_->GetProfile()->GetPrefs(); |
203 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); | 203 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); |
204 } | 204 } |
205 | 205 |
206 int BrowserOptionsHandler::StatusStringIdForState( | 206 int BrowserOptionsHandler::StatusStringIdForState( |
207 ShellIntegration::DefaultBrowserState state) { | 207 ShellIntegration::DefaultBrowserState state) { |
208 if (state == ShellIntegration::IS_DEFAULT_BROWSER) | 208 if (state == ShellIntegration::IS_DEFAULT_BROWSER) |
209 return IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; | 209 return IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; |
210 if (state == ShellIntegration::NOT_DEFAULT_BROWSER) | 210 if (state == ShellIntegration::NOT_DEFAULT_BROWSER) |
211 return IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; | 211 return IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; |
212 return IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; | 212 return IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 } | 408 } |
409 | 409 |
410 void BrowserOptionsHandler::SaveStartupPagesPref() { | 410 void BrowserOptionsHandler::SaveStartupPagesPref() { |
411 PrefService* prefs = dom_ui_->GetProfile()->GetPrefs(); | 411 PrefService* prefs = dom_ui_->GetProfile()->GetPrefs(); |
412 | 412 |
413 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); | 413 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); |
414 pref.urls = startup_custom_pages_table_model_->GetURLs(); | 414 pref.urls = startup_custom_pages_table_model_->GetURLs(); |
415 | 415 |
416 SessionStartupPref::SetStartupPref(prefs, pref); | 416 SessionStartupPref::SetStartupPref(prefs, pref); |
417 } | 417 } |
OLD | NEW |