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 18 matching lines...) Expand all Loading... | |
29 #include "content/public/browser/web_contents.h" | 29 #include "content/public/browser/web_contents.h" |
30 #include "google_apis/gaia/gaia_urls.h" | 30 #include "google_apis/gaia/gaia_urls.h" |
31 #include "net/base/url_util.h" | 31 #include "net/base/url_util.h" |
32 | 32 |
33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
34 #include "chrome/browser/enumerate_modules_model_win.h" | 34 #include "chrome/browser/enumerate_modules_model_win.h" |
35 #endif | 35 #endif |
36 | 36 |
37 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
38 #include "chrome/browser/chromeos/genius_app/app_id.h" | 38 #include "chrome/browser/chromeos/genius_app/app_id.h" |
39 #include "chromeos/chromeos_switches.h" | |
40 #include "extensions/browser/extension_registry.h" | 39 #include "extensions/browser/extension_registry.h" |
41 #endif | 40 #endif |
42 | 41 |
43 using base::UserMetricsAction; | 42 using base::UserMetricsAction; |
44 | 43 |
45 namespace chrome { | 44 namespace chrome { |
46 namespace { | 45 namespace { |
47 | 46 |
48 const char kHashMark[] = "#"; | 47 const char kHashMark[] = "#"; |
49 | 48 |
(...skipping 19 matching lines...) Expand all Loading... | |
69 // Shows either the help app or the appropriate help page for |source|. If | 68 // Shows either the help app or the appropriate help page for |source|. If |
70 // |browser| is NULL and the help page is used (vs the app), the help page is | 69 // |browser| is NULL and the help page is used (vs the app), the help page is |
71 // shown in the last active browser. If there is no such browser, a new browser | 70 // shown in the last active browser. If there is no such browser, a new browser |
72 // is created. | 71 // is created. |
73 void ShowHelpImpl(Browser* browser, | 72 void ShowHelpImpl(Browser* browser, |
74 Profile* profile, | 73 Profile* profile, |
75 HostDesktopType host_desktop_type, | 74 HostDesktopType host_desktop_type, |
76 HelpSource source) { | 75 HelpSource source) { |
77 content::RecordAction(UserMetricsAction("ShowHelpTab")); | 76 content::RecordAction(UserMetricsAction("ShowHelpTab")); |
78 #if defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD) | 77 #if defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD) |
79 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 78 const extensions::Extension* extension = |
80 if (!command_line->HasSwitch(chromeos::switches::kDisableGeniusApp)) { | 79 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( |
81 const extensions::Extension* extension = | 80 genius_app::kGeniusAppId, |
82 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( | 81 extensions::ExtensionRegistry::EVERYTHING); |
83 genius_app::kGeniusAppId, | 82 OpenApplication(AppLaunchParams(profile, extension, 0, host_desktop_type)); |
84 extensions::ExtensionRegistry::EVERYTHING); | 83 return; |
sky
2014/09/17 19:43:25
Nuke the return and make 84 a #else.
cylee1
2014/09/18 11:10:30
Done.
| |
85 OpenApplication(AppLaunchParams(profile, extension, 0, host_desktop_type)); | |
86 return; | |
87 } | |
88 #endif | 84 #endif |
89 GURL url; | 85 GURL url; |
90 switch (source) { | 86 switch (source) { |
91 case HELP_SOURCE_KEYBOARD: | 87 case HELP_SOURCE_KEYBOARD: |
92 url = GURL(kChromeHelpViaKeyboardURL); | 88 url = GURL(kChromeHelpViaKeyboardURL); |
93 break; | 89 break; |
94 case HELP_SOURCE_MENU: | 90 case HELP_SOURCE_MENU: |
95 url = GURL(kChromeHelpViaMenuURL); | 91 url = GURL(kChromeHelpViaMenuURL); |
96 break; | 92 break; |
97 case HELP_SOURCE_WEBUI: | 93 case HELP_SOURCE_WEBUI: |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 original_profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); | 319 original_profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); |
324 browser = displayer->browser(); | 320 browser = displayer->browser(); |
325 } | 321 } |
326 | 322 |
327 NavigateToSingletonTab(browser, GURL(signin::GetPromoURL(source, false))); | 323 NavigateToSingletonTab(browser, GURL(signin::GetPromoURL(source, false))); |
328 DCHECK_GT(browser->tab_strip_model()->count(), 0); | 324 DCHECK_GT(browser->tab_strip_model()->count(), 0); |
329 } | 325 } |
330 } | 326 } |
331 | 327 |
332 } // namespace chrome | 328 } // namespace chrome |
OLD | NEW |