| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "chrome/browser/download/download_shelf.h" | 14 #include "chrome/browser/download/download_shelf.h" |
| 15 #include "chrome/browser/extensions/launch_util.h" | |
| 16 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 18 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/browser_finder.h" | 18 #include "chrome/browser/ui/browser_finder.h" |
| 20 #include "chrome/browser/ui/browser_navigator_params.h" | 19 #include "chrome/browser/ui/browser_navigator_params.h" |
| 21 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
| 22 #include "chrome/browser/ui/extensions/app_launch_params.h" | 21 #include "chrome/browser/ui/extensions/app_launch_params.h" |
| 23 #include "chrome/browser/ui/extensions/application_launch.h" | 22 #include "chrome/browser/ui/extensions/application_launch.h" |
| 24 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 23 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 25 #include "chrome/browser/ui/settings_window_manager.h" | 24 #include "chrome/browser/ui/settings_window_manager.h" |
| 26 #include "chrome/browser/ui/singleton_tabs.h" | 25 #include "chrome/browser/ui/singleton_tabs.h" |
| 27 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 26 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 28 #include "chrome/browser/ui/webui/options/content_settings_handler.h" | 27 #include "chrome/browser/ui/webui/options/content_settings_handler.h" |
| 29 #include "chrome/browser/ui/webui/site_settings_helper.h" | 28 #include "chrome/browser/ui/webui/site_settings_helper.h" |
| 30 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| 31 #include "chrome/common/url_constants.h" | 30 #include "chrome/common/url_constants.h" |
| 32 #include "components/signin/core/browser/signin_header_helper.h" | 31 #include "components/signin/core/browser/signin_header_helper.h" |
| 33 #include "components/signin/core/common/profile_management_switches.h" | 32 #include "components/signin/core/common/profile_management_switches.h" |
| 34 #include "content/public/browser/user_metrics.h" | 33 #include "content/public/browser/user_metrics.h" |
| 35 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
| 36 #include "extensions/browser/extension_prefs.h" | |
| 37 #include "extensions/common/constants.h" | 35 #include "extensions/common/constants.h" |
| 38 #include "google_apis/gaia/gaia_urls.h" | 36 #include "google_apis/gaia/gaia_urls.h" |
| 39 #include "net/base/url_util.h" | 37 #include "net/base/url_util.h" |
| 40 #include "ui/base/window_open_disposition.h" | 38 #include "ui/base/window_open_disposition.h" |
| 41 | 39 |
| 42 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
| 43 #include "chrome/browser/win/enumerate_modules_model.h" | 41 #include "chrome/browser/win/enumerate_modules_model.h" |
| 44 #endif | 42 #endif |
| 45 | 43 |
| 46 #if defined(OS_CHROMEOS) | 44 #if defined(OS_CHROMEOS) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 break; | 95 break; |
| 98 case HELP_SOURCE_MENU: | 96 case HELP_SOURCE_MENU: |
| 99 app_launch_source = extensions::SOURCE_SYSTEM_TRAY; | 97 app_launch_source = extensions::SOURCE_SYSTEM_TRAY; |
| 100 break; | 98 break; |
| 101 case HELP_SOURCE_WEBUI: | 99 case HELP_SOURCE_WEBUI: |
| 102 app_launch_source = extensions::SOURCE_ABOUT_PAGE; | 100 app_launch_source = extensions::SOURCE_ABOUT_PAGE; |
| 103 break; | 101 break; |
| 104 default: | 102 default: |
| 105 NOTREACHED() << "Unhandled help source" << source; | 103 NOTREACHED() << "Unhandled help source" << source; |
| 106 } | 104 } |
| 107 OpenApplication( | 105 OpenApplication(CreateAppLaunchParamsUserContainer( |
| 108 AppLaunchParams(profile, extension, | 106 profile, extension, NEW_FOREGROUND_TAB, app_launch_source)); |
| 109 extensions::GetLaunchContainer( | |
| 110 extensions::ExtensionPrefs::Get(profile), extension), | |
| 111 NEW_FOREGROUND_TAB, source, true)); | |
| 112 #else | 107 #else |
| 113 GURL url; | 108 GURL url; |
| 114 switch (source) { | 109 switch (source) { |
| 115 case HELP_SOURCE_KEYBOARD: | 110 case HELP_SOURCE_KEYBOARD: |
| 116 url = GURL(kChromeHelpViaKeyboardURL); | 111 url = GURL(kChromeHelpViaKeyboardURL); |
| 117 break; | 112 break; |
| 118 case HELP_SOURCE_MENU: | 113 case HELP_SOURCE_MENU: |
| 119 url = GURL(kChromeHelpViaMenuURL); | 114 url = GURL(kChromeHelpViaMenuURL); |
| 120 break; | 115 break; |
| 121 case HELP_SOURCE_WEBUI: | 116 case HELP_SOURCE_WEBUI: |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 SigninManagerFactory::GetForProfile(original_profile); | 393 SigninManagerFactory::GetForProfile(original_profile); |
| 399 DCHECK(manager->IsSigninAllowed()); | 394 DCHECK(manager->IsSigninAllowed()); |
| 400 if (manager->IsAuthenticated()) | 395 if (manager->IsAuthenticated()) |
| 401 ShowSettings(browser); | 396 ShowSettings(browser); |
| 402 else | 397 else |
| 403 ShowBrowserSignin(browser, access_point); | 398 ShowBrowserSignin(browser, access_point); |
| 404 } | 399 } |
| 405 #endif | 400 #endif |
| 406 | 401 |
| 407 } // namespace chrome | 402 } // namespace chrome |
| OLD | NEW |