Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser_init.h" | 5 #include "chrome/browser/browser_init.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/event_recorder.h" | 9 #include "base/event_recorder.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 #include "chrome/browser/tab_contents/tab_contents.h" | 33 #include "chrome/browser/tab_contents/tab_contents.h" |
| 34 #include "chrome/browser/tab_contents/tab_contents_view.h" | 34 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 35 #include "chrome/browser/net/url_fixer_upper.h" | 35 #include "chrome/browser/net/url_fixer_upper.h" |
| 36 #include "chrome/browser/user_data_manager.h" | 36 #include "chrome/browser/user_data_manager.h" |
| 37 #include "chrome/common/chrome_constants.h" | 37 #include "chrome/common/chrome_constants.h" |
| 38 #include "chrome/common/chrome_paths.h" | 38 #include "chrome/common/chrome_paths.h" |
| 39 #include "chrome/common/chrome_switches.h" | 39 #include "chrome/common/chrome_switches.h" |
| 40 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
| 41 #include "chrome/common/result_codes.h" | 41 #include "chrome/common/result_codes.h" |
| 42 #include "chrome/common/url_constants.h" | 42 #include "chrome/common/url_constants.h" |
| 43 #include "chrome/installer/util/browser_distribution.h" | |
| 43 #include "grit/chromium_strings.h" | 44 #include "grit/chromium_strings.h" |
| 44 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
| 45 #include "grit/locale_settings.h" | 46 #include "grit/locale_settings.h" |
| 46 #include "grit/theme_resources.h" | 47 #include "grit/theme_resources.h" |
| 47 #include "net/base/net_util.h" | 48 #include "net/base/net_util.h" |
| 48 #include "net/http/http_network_layer.h" | 49 #include "net/http/http_network_layer.h" |
| 49 #include "net/url_request/url_request.h" | 50 #include "net/url_request/url_request.h" |
| 50 #include "webkit/glue/webkit_glue.h" | 51 #include "webkit/glue/webkit_glue.h" |
| 51 | 52 |
| 52 #if defined(OS_MACOSX) | 53 #if defined(OS_MACOSX) |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 }; | 187 }; |
| 187 | 188 |
| 188 class CheckDefaultBrowserTask : public Task { | 189 class CheckDefaultBrowserTask : public Task { |
| 189 public: | 190 public: |
| 190 CheckDefaultBrowserTask() { | 191 CheckDefaultBrowserTask() { |
| 191 } | 192 } |
| 192 | 193 |
| 193 virtual void Run() { | 194 virtual void Run() { |
| 194 if (ShellIntegration::IsDefaultBrowser()) | 195 if (ShellIntegration::IsDefaultBrowser()) |
| 195 return; | 196 return; |
| 197 #if defined(OS_WIN) | |
| 198 if (!BrowserDistribution::GetDistribution()->CanSetAsDefault()) | |
| 199 return; | |
|
mattm
2010/02/26 23:53:50
could do this check before the IsDefaultBrowser ca
huanr
2010/02/27 00:02:34
However we should optimize for the more common cas
| |
| 200 #endif | |
| 196 | 201 |
| 197 ChromeThread::PostTask( | 202 ChromeThread::PostTask( |
| 198 ChromeThread::UI, FROM_HERE, new NotifyNotDefaultBrowserTask()); | 203 ChromeThread::UI, FROM_HERE, new NotifyNotDefaultBrowserTask()); |
| 199 } | 204 } |
| 200 | 205 |
| 201 private: | 206 private: |
| 202 DISALLOW_COPY_AND_ASSIGN(CheckDefaultBrowserTask); | 207 DISALLOW_COPY_AND_ASSIGN(CheckDefaultBrowserTask); |
| 203 }; | 208 }; |
| 204 | 209 |
| 205 // A delegate for the InfoBar shown when the previous session has crashed. The | 210 // A delegate for the InfoBar shown when the previous session has crashed. The |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 928 scoped_refptr<AutomationProviderClass> automation = | 933 scoped_refptr<AutomationProviderClass> automation = |
| 929 new AutomationProviderClass(profile); | 934 new AutomationProviderClass(profile); |
| 930 automation->ConnectToChannel(channel_id); | 935 automation->ConnectToChannel(channel_id); |
| 931 automation->SetExpectedTabCount(expected_tabs); | 936 automation->SetExpectedTabCount(expected_tabs); |
| 932 | 937 |
| 933 AutomationProviderList* list = | 938 AutomationProviderList* list = |
| 934 g_browser_process->InitAutomationProviderList(); | 939 g_browser_process->InitAutomationProviderList(); |
| 935 DCHECK(list); | 940 DCHECK(list); |
| 936 list->AddProvider(automation); | 941 list->AddProvider(automation); |
| 937 } | 942 } |
| OLD | NEW |