Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: chrome/browser/ui/chrome_pages.cc

Issue 23548023: Add a new component app Guide to Chrome (code name GeniusApp) to replace HelpApp. Add a command lin… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/logging.h" 8 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/download/download_shelf.h" 11 #include "chrome/browser/download/download_shelf.h"
12 #include "chrome/browser/extensions/extension_service.h"
11 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/profiles/profile_manager.h"
12 #include "chrome/browser/signin/signin_manager.h" 15 #include "chrome/browser/signin/signin_manager.h"
13 #include "chrome/browser/signin/signin_manager_factory.h" 16 #include "chrome/browser/signin/signin_manager_factory.h"
14 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/browser_finder.h" 18 #include "chrome/browser/ui/browser_finder.h"
16 #include "chrome/browser/ui/browser_navigator.h" 19 #include "chrome/browser/ui/browser_navigator.h"
17 #include "chrome/browser/ui/browser_window.h" 20 #include "chrome/browser/ui/browser_window.h"
21 #include "chrome/browser/ui/extensions/application_launch.h"
18 #include "chrome/browser/ui/singleton_tabs.h" 22 #include "chrome/browser/ui/singleton_tabs.h"
19 #include "chrome/browser/ui/tabs/tab_strip_model.h" 23 #include "chrome/browser/ui/tabs/tab_strip_model.h"
20 #include "chrome/browser/ui/webui/options/content_settings_handler.h" 24 #include "chrome/browser/ui/webui/options/content_settings_handler.h"
25 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/url_constants.h" 26 #include "chrome/common/url_constants.h"
22 #include "content/public/browser/user_metrics.h" 27 #include "content/public/browser/user_metrics.h"
23 #include "google_apis/gaia/gaia_urls.h" 28 #include "google_apis/gaia/gaia_urls.h"
24 #include "net/base/url_util.h" 29 #include "net/base/url_util.h"
25 #include "url/gurl.h" 30 #include "url/gurl.h"
26 31
27 #if defined(OS_WIN) 32 #if defined(OS_WIN)
28 #include "chrome/browser/enumerate_modules_model_win.h" 33 #include "chrome/browser/enumerate_modules_model_win.h"
29 #endif 34 #endif
30 35
36 #if defined(OS_CHROMEOS)
37 #include "chrome/browser/chromeos/genius_app/app_id.h"
38 #endif
39
31 using content::UserMetricsAction; 40 using content::UserMetricsAction;
32 41
33 namespace chrome { 42 namespace chrome {
34 namespace { 43 namespace {
35 44
36 const char kHashMark[] = "#"; 45 const char kHashMark[] = "#";
37 46
38 void OpenBookmarkManagerWithHash(Browser* browser, 47 void OpenBookmarkManagerWithHash(Browser* browser,
39 const std::string& action, 48 const std::string& action,
40 int64 node_id) { 49 int64 node_id) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 128 }
120 } 129 }
121 #endif 130 #endif
122 131
123 content::RecordAction(UserMetricsAction("AboutConflicts")); 132 content::RecordAction(UserMetricsAction("AboutConflicts"));
124 ShowSingletonTab(browser, GURL(kChromeUIConflictsURL)); 133 ShowSingletonTab(browser, GURL(kChromeUIConflictsURL));
125 } 134 }
126 135
127 void ShowHelp(Browser* browser, HelpSource source) { 136 void ShowHelp(Browser* browser, HelpSource source) {
128 content::RecordAction(UserMetricsAction("ShowHelpTab")); 137 content::RecordAction(UserMetricsAction("ShowHelpTab"));
138 #if defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD)
139 const CommandLine* command_line = CommandLine::ForCurrentProcess();
140 if (!command_line->HasSwitch(switches::kDisableGeniusApp)) {
141 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord();
142 const extensions::Extension* extension = profile->GetExtensionService()->
143 GetInstalledExtension(genius_app::kGeniusAppId);
144 OpenApplication(AppLaunchParams(profile, extension, 0));
145 return;
146 }
147 #endif
129 GURL url; 148 GURL url;
130 switch (source) { 149 switch (source) {
131 case HELP_SOURCE_KEYBOARD: 150 case HELP_SOURCE_KEYBOARD:
132 url = GURL(kChromeHelpViaKeyboardURL); 151 url = GURL(kChromeHelpViaKeyboardURL);
133 break; 152 break;
134 case HELP_SOURCE_MENU: 153 case HELP_SOURCE_MENU:
135 url = GURL(kChromeHelpViaMenuURL); 154 url = GURL(kChromeHelpViaMenuURL);
136 break; 155 break;
137 case HELP_SOURCE_WEBUI: 156 case HELP_SOURCE_WEBUI:
138 url = GURL(kChromeHelpViaWebUIURL); 157 url = GURL(kChromeHelpViaWebUIURL);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 const std::string& service, 257 const std::string& service,
239 const GURL& continue_url) { 258 const GURL& continue_url) {
240 GURL url(GaiaUrls::GetInstance()->service_login_url()); 259 GURL url(GaiaUrls::GetInstance()->service_login_url());
241 url = net::AppendQueryParameter(url, "service", service); 260 url = net::AppendQueryParameter(url, "service", service);
242 if (continue_url.is_valid()) 261 if (continue_url.is_valid())
243 url = net::AppendQueryParameter(url, "continue", continue_url.spec()); 262 url = net::AppendQueryParameter(url, "continue", continue_url.spec());
244 NavigateToSingletonTab(browser, url); 263 NavigateToSingletonTab(browser, url);
245 } 264 }
246 265
247 } // namespace chrome 266 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698