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

Side by Side Diff: chrome/browser/shell_integration.h

Issue 13864015: Move app launcher and chrome apps shortcut strings into the installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migrate_app_id_fix
Patch Set: fix nits Created 7 years, 1 month 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 #ifndef CHROME_BROWSER_SHELL_INTEGRATION_H_ 5 #ifndef CHROME_BROWSER_SHELL_INTEGRATION_H_
6 #define CHROME_BROWSER_SHELL_INTEGRATION_H_ 6 #define CHROME_BROWSER_SHELL_INTEGRATION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 std::string extension_id; 99 std::string extension_id;
100 bool is_platform_app; 100 bool is_platform_app;
101 string16 title; 101 string16 title;
102 string16 description; 102 string16 description;
103 base::FilePath extension_path; 103 base::FilePath extension_path;
104 gfx::ImageFamily favicon; 104 gfx::ImageFamily favicon;
105 base::FilePath profile_path; 105 base::FilePath profile_path;
106 std::string profile_name; 106 std::string profile_name;
107 }; 107 };
108 108
109 // For Windows, these refer to "Start Menu", "Start Menu/Google Chrome",
110 // and "Start Menu/Chrome Apps" respectively.
111 enum ApplicationsMenuLocation {
112 APP_MENU_LOCATION_NONE,
113 APP_MENU_LOCATION_ROOT,
114 APP_MENU_LOCATION_SUBDIR_CHROME,
115 APP_MENU_LOCATION_SUBDIR_CHROMEAPPS,
116 };
117
109 // Info about which locations to create app shortcuts in. 118 // Info about which locations to create app shortcuts in.
110 struct ShortcutLocations { 119 struct ShortcutLocations {
111 ShortcutLocations(); 120 ShortcutLocations();
112 121
113 bool on_desktop; 122 bool on_desktop;
114 bool in_applications_menu; 123
115 string16 applications_menu_subdir; 124 ApplicationsMenuLocation applications_menu_location;
116 125
117 // For Windows, this refers to quick launch bar prior to Win7. In Win7, 126 // For Windows, this refers to quick launch bar prior to Win7. In Win7,
118 // this means "pin to taskbar". For Mac/Linux, this could be used for 127 // this means "pin to taskbar". For Mac/Linux, this could be used for
119 // Mac dock or the gnome/kde application launcher. However, those are not 128 // Mac dock or the gnome/kde application launcher. However, those are not
120 // implemented yet. 129 // implemented yet.
121 bool in_quick_launch_bar; 130 bool in_quick_launch_bar;
122 131
132 #if defined(OS_POSIX)
123 // For Linux, this refers to a shortcut which the system knows about (for 133 // For Linux, this refers to a shortcut which the system knows about (for
124 // the purpose of identifying windows and giving them the correct 134 // the purpose of identifying windows and giving them the correct
125 // title/icon), but which does not show up in menus or search results. 135 // title/icon), but which does not show up in menus or search results.
126 // Ignored if in_applications_menu == true. 136 // Ignored if applications_menu_location is not APP_MENU_LOCATION_NONE.
127 bool hidden; 137 bool hidden;
138 #endif
128 }; 139 };
129 140
130 // Data that needs to be passed between the app launcher stub and Chrome. 141 // Data that needs to be passed between the app launcher stub and Chrome.
131 struct AppModeInfo { 142 struct AppModeInfo {
132 }; 143 };
133 static void SetAppModeInfo(const AppModeInfo* info); 144 static void SetAppModeInfo(const AppModeInfo* info);
134 static const AppModeInfo* AppModeInfo(); 145 static const AppModeInfo* AppModeInfo();
135 146
136 // Is the current instance of Chrome running in App mode. 147 // Is the current instance of Chrome running in App mode.
137 bool IsRunningInAppMode(); 148 bool IsRunningInAppMode();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // This method is only public for the sake of tests and shouldn't be called 189 // This method is only public for the sake of tests and shouldn't be called
179 // externally otherwise. 190 // externally otherwise.
180 static int MigrateShortcutsInPathInternal(const base::FilePath& chrome_exe, 191 static int MigrateShortcutsInPathInternal(const base::FilePath& chrome_exe,
181 const base::FilePath& path, 192 const base::FilePath& path,
182 bool check_dual_mode); 193 bool check_dual_mode);
183 194
184 // Returns the path to the Start Menu shortcut for the given Chrome. 195 // Returns the path to the Start Menu shortcut for the given Chrome.
185 static base::FilePath GetStartMenuShortcut(const base::FilePath& chrome_exe); 196 static base::FilePath GetStartMenuShortcut(const base::FilePath& chrome_exe);
186 #endif // defined(OS_WIN) 197 #endif // defined(OS_WIN)
187 198
199 #if !defined(OS_WIN)
200 // TODO(calamity): replace with
201 // BrowserDistribution::GetStartMenuShortcutSubfolder() once
202 // BrowserDistribution is cross-platform.
203 // Gets the name of the Chrome Apps menu folder in which to place app
204 // shortcuts. This is needed for Mac and Linux.
205 static base::string16 GetAppShortcutsSubdirName();
206 #endif
207
188 // The current default web client application UI state. This is used when 208 // The current default web client application UI state. This is used when
189 // querying if Chrome is the default browser or the default handler 209 // querying if Chrome is the default browser or the default handler
190 // application for a url protocol, and communicates the state and result of 210 // application for a url protocol, and communicates the state and result of
191 // a request. 211 // a request.
192 enum DefaultWebClientUIState { 212 enum DefaultWebClientUIState {
193 STATE_PROCESSING, 213 STATE_PROCESSING,
194 STATE_NOT_DEFAULT, 214 STATE_NOT_DEFAULT,
195 STATE_IS_DEFAULT, 215 STATE_IS_DEFAULT,
196 STATE_UNKNOWN 216 STATE_UNKNOWN
197 }; 217 };
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 // Set Chrome as the default handler for this protocol. 346 // Set Chrome as the default handler for this protocol.
327 virtual bool SetAsDefault(bool interactive_permitted) OVERRIDE; 347 virtual bool SetAsDefault(bool interactive_permitted) OVERRIDE;
328 348
329 std::string protocol_; 349 std::string protocol_;
330 350
331 DISALLOW_COPY_AND_ASSIGN(DefaultProtocolClientWorker); 351 DISALLOW_COPY_AND_ASSIGN(DefaultProtocolClientWorker);
332 }; 352 };
333 }; 353 };
334 354
335 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ 355 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698