| 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(ANDROID_JAVA_UI) && !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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 GetSingletonTabNavigateParams(browser, GURL(kChromeUIHelpURL))); | 349 GetSingletonTabNavigateParams(browser, GURL(kChromeUIHelpURL))); |
| 350 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; | 350 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; |
| 351 ShowSingletonTabOverwritingNTP(browser, params); | 351 ShowSingletonTabOverwritingNTP(browser, params); |
| 352 } | 352 } |
| 353 | 353 |
| 354 void ShowSearchEngineSettings(Browser* browser) { | 354 void ShowSearchEngineSettings(Browser* browser) { |
| 355 content::RecordAction(UserMetricsAction("EditSearchEngines")); | 355 content::RecordAction(UserMetricsAction("EditSearchEngines")); |
| 356 ShowSettingsSubPage(browser, kSearchEnginesSubPage); | 356 ShowSettingsSubPage(browser, kSearchEnginesSubPage); |
| 357 } | 357 } |
| 358 | 358 |
| 359 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 359 #if !defined(ANDROID_JAVA_UI) && !defined(OS_IOS) |
| 360 void ShowBrowserSignin(Browser* browser, signin_metrics::Source source) { | 360 void ShowBrowserSignin(Browser* browser, signin_metrics::Source source) { |
| 361 Profile* original_profile = browser->profile()->GetOriginalProfile(); | 361 Profile* original_profile = browser->profile()->GetOriginalProfile(); |
| 362 SigninManagerBase* manager = | 362 SigninManagerBase* manager = |
| 363 SigninManagerFactory::GetForProfile(original_profile); | 363 SigninManagerFactory::GetForProfile(original_profile); |
| 364 DCHECK(manager->IsSigninAllowed()); | 364 DCHECK(manager->IsSigninAllowed()); |
| 365 // If the browser's profile is an incognito profile, make sure to use | 365 // If the browser's profile is an incognito profile, make sure to use |
| 366 // a browser window from the original profile. The user cannot sign in | 366 // a browser window from the original profile. The user cannot sign in |
| 367 // from an incognito window. | 367 // from an incognito window. |
| 368 bool switched_browser = false; | 368 bool switched_browser = false; |
| 369 scoped_ptr<ScopedTabbedBrowserDisplayer> displayer; | 369 scoped_ptr<ScopedTabbedBrowserDisplayer> displayer; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 SigninManagerFactory::GetForProfile(original_profile); | 405 SigninManagerFactory::GetForProfile(original_profile); |
| 406 DCHECK(manager->IsSigninAllowed()); | 406 DCHECK(manager->IsSigninAllowed()); |
| 407 if (manager->IsAuthenticated()) | 407 if (manager->IsAuthenticated()) |
| 408 ShowSettings(browser); | 408 ShowSettings(browser); |
| 409 else | 409 else |
| 410 ShowBrowserSignin(browser, source); | 410 ShowBrowserSignin(browser, source); |
| 411 } | 411 } |
| 412 #endif | 412 #endif |
| 413 | 413 |
| 414 } // namespace chrome | 414 } // namespace chrome |
| OLD | NEW |