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/chrome_pages.h" | 5 #include "chrome/browser/ui/chrome_pages.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
37 #include "chrome/browser/enumerate_modules_model_win.h" | 37 #include "chrome/browser/enumerate_modules_model_win.h" |
38 #endif | 38 #endif |
39 | 39 |
40 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
41 #include "chrome/browser/chromeos/genius_app/app_id.h" | 41 #include "chrome/browser/chromeos/genius_app/app_id.h" |
42 #include "extensions/browser/extension_registry.h" | 42 #include "extensions/browser/extension_registry.h" |
43 #endif | 43 #endif |
44 | 44 |
45 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 45 #if !defined(OS_IOS) |
46 #include "chrome/browser/signin/signin_manager_factory.h" | 46 #include "chrome/browser/signin/signin_manager_factory.h" |
47 #include "components/signin/core/browser/signin_manager.h" | 47 #include "components/signin/core/browser/signin_manager.h" |
48 #endif | 48 #endif |
49 | 49 |
50 using base::UserMetricsAction; | 50 using base::UserMetricsAction; |
51 | 51 |
52 namespace chrome { | 52 namespace chrome { |
53 namespace { | 53 namespace { |
54 | 54 |
55 const char kHashMark[] = "#"; | 55 const char kHashMark[] = "#"; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 GetSingletonTabNavigateParams(browser, GURL(kChromeUIUberURL))); | 339 GetSingletonTabNavigateParams(browser, GURL(kChromeUIUberURL))); |
340 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; | 340 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; |
341 ShowSingletonTabOverwritingNTP(browser, params); | 341 ShowSingletonTabOverwritingNTP(browser, params); |
342 } | 342 } |
343 | 343 |
344 void ShowSearchEngineSettings(Browser* browser) { | 344 void ShowSearchEngineSettings(Browser* browser) { |
345 content::RecordAction(UserMetricsAction("EditSearchEngines")); | 345 content::RecordAction(UserMetricsAction("EditSearchEngines")); |
346 ShowSettingsSubPage(browser, kSearchEnginesSubPage); | 346 ShowSettingsSubPage(browser, kSearchEnginesSubPage); |
347 } | 347 } |
348 | 348 |
349 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 349 #if !defined(OS_IOS) |
350 void ShowBrowserSignin(Browser* browser, signin_metrics::Source source) { | 350 void ShowBrowserSignin(Browser* browser, signin_metrics::Source source) { |
351 Profile* original_profile = browser->profile()->GetOriginalProfile(); | 351 Profile* original_profile = browser->profile()->GetOriginalProfile(); |
352 SigninManagerBase* manager = | 352 SigninManagerBase* manager = |
353 SigninManagerFactory::GetForProfile(original_profile); | 353 SigninManagerFactory::GetForProfile(original_profile); |
354 DCHECK(manager->IsSigninAllowed()); | 354 DCHECK(manager->IsSigninAllowed()); |
355 // If the browser's profile is an incognito profile, make sure to use | 355 // If the browser's profile is an incognito profile, make sure to use |
356 // a browser window from the original profile. The user cannot sign in | 356 // a browser window from the original profile. The user cannot sign in |
357 // from an incognito window. | 357 // from an incognito window. |
358 bool switched_browser = false; | 358 bool switched_browser = false; |
359 scoped_ptr<ScopedTabbedBrowserDisplayer> displayer; | 359 scoped_ptr<ScopedTabbedBrowserDisplayer> displayer; |
(...skipping 29 matching lines...) Expand all Loading... |
389 SigninManagerFactory::GetForProfile(original_profile); | 389 SigninManagerFactory::GetForProfile(original_profile); |
390 DCHECK(manager->IsSigninAllowed()); | 390 DCHECK(manager->IsSigninAllowed()); |
391 if (manager->IsAuthenticated()) | 391 if (manager->IsAuthenticated()) |
392 ShowSettings(browser); | 392 ShowSettings(browser); |
393 else | 393 else |
394 ShowBrowserSignin(browser, source); | 394 ShowBrowserSignin(browser, source); |
395 } | 395 } |
396 #endif | 396 #endif |
397 | 397 |
398 } // namespace chrome | 398 } // namespace chrome |
OLD | NEW |