| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/webui/set_as_default_browser_ui.h" | 5 #include "chrome/browser/ui/webui/set_as_default_browser_ui.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 13 #include "base/win/win_util.h" | 13 #include "base/win/win_util.h" |
| 14 #include "chrome/browser/first_run/first_run.h" | 14 #include "chrome/browser/first_run/first_run.h" |
| 15 #include "chrome/browser/lifetime/application_lifetime.h" | 15 #include "chrome/browser/lifetime/application_lifetime.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/shell_integration.h" | 17 #include "chrome/browser/shell_integration.h" |
| 18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/browser_dialogs.h" | 19 #include "chrome/browser/ui/browser_dialogs.h" |
| 20 #include "chrome/browser/ui/browser_finder.h" | 20 #include "chrome/browser/ui/browser_finder.h" |
| 21 #include "chrome/browser/ui/browser_list.h" | 21 #include "chrome/browser/ui/browser_list.h" |
| 22 #include "chrome/browser/ui/browser_list_observer.h" | 22 #include "chrome/browser/ui/browser_list_observer.h" |
| 23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
| 24 #include "chrome/browser/ui/chrome_pages.h" | 24 #include "chrome/browser/ui/chrome_pages.h" |
| 25 #include "chrome/browser/ui/singleton_tabs.h" | 25 #include "chrome/browser/ui/singleton_tabs.h" |
| 26 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
| 26 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 27 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 27 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" | |
| 28 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 30 #include "chrome/installer/util/install_util.h" | 30 #include "chrome/installer/util/install_util.h" |
| 31 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
| 32 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
| 33 #include "content/public/browser/web_contents_delegate.h" | 33 #include "content/public/browser/web_contents_delegate.h" |
| 34 #include "content/public/browser/web_contents_view.h" | 34 #include "content/public/browser/web_contents_view.h" |
| 35 #include "content/public/browser/web_ui.h" | 35 #include "content/public/browser/web_ui.h" |
| 36 #include "content/public/browser/web_ui_data_source.h" | 36 #include "content/public/browser/web_ui_data_source.h" |
| 37 #include "content/public/browser/web_ui_message_handler.h" | 37 #include "content/public/browser/web_ui_message_handler.h" |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 Profile::FromWebUI(web_ui), CreateSetAsDefaultBrowserUIHTMLSource()); | 411 Profile::FromWebUI(web_ui), CreateSetAsDefaultBrowserUIHTMLSource()); |
| 412 } | 412 } |
| 413 | 413 |
| 414 // static | 414 // static |
| 415 void SetAsDefaultBrowserUI::Show(Profile* profile, Browser* browser) { | 415 void SetAsDefaultBrowserUI::Show(Profile* profile, Browser* browser) { |
| 416 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 416 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 417 SetAsDefaultBrowserDialogImpl* dialog = | 417 SetAsDefaultBrowserDialogImpl* dialog = |
| 418 new SetAsDefaultBrowserDialogImpl(profile, browser); | 418 new SetAsDefaultBrowserDialogImpl(profile, browser); |
| 419 dialog->ShowDialog(); | 419 dialog->ShowDialog(); |
| 420 } | 420 } |
| OLD | NEW |