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

Side by Side Diff: chrome/browser/ui/extensions/application_launch.cc

Issue 17038002: Separate the NTP app ordering from the app list app ordering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 2 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/extensions/application_launch.h" 5 #include "chrome/browser/ui/extensions/application_launch.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "apps/launcher.h" 9 #include "apps/launcher.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 WebContents* OpenApplicationWindow( 115 WebContents* OpenApplicationWindow(
116 Profile* profile, 116 Profile* profile,
117 const Extension* extension, 117 const Extension* extension,
118 extension_misc::LaunchContainer container, 118 extension_misc::LaunchContainer container,
119 const GURL& url_input, 119 const GURL& url_input,
120 Browser** app_browser, 120 Browser** app_browser,
121 const gfx::Rect& override_bounds) { 121 const gfx::Rect& override_bounds) {
122 DCHECK(!url_input.is_empty() || extension); 122 DCHECK(!url_input.is_empty() || extension);
123 LOG(ERROR) << "OpenApplicationWindow";
stevenjb 2013/10/08 18:10:08 VLOG
123 GURL url = UrlForExtension(extension, url_input); 124 GURL url = UrlForExtension(extension, url_input);
124 125
125 std::string app_name; 126 std::string app_name;
126 app_name = extension ? 127 app_name = extension ?
127 web_app::GenerateApplicationNameFromExtensionId(extension->id()) : 128 web_app::GenerateApplicationNameFromExtensionId(extension->id()) :
128 web_app::GenerateApplicationNameFromURL(url); 129 web_app::GenerateApplicationNameFromURL(url);
129 130
130 Browser::Type type = Browser::TYPE_POPUP; 131 Browser::Type type = Browser::TYPE_POPUP;
131 132
132 gfx::Rect window_bounds; 133 gfx::Rect window_bounds;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } 199 }
199 200
200 // Check the prefs for overridden mode. 201 // Check the prefs for overridden mode.
201 ExtensionService* extension_service = 202 ExtensionService* extension_service =
202 extensions::ExtensionSystem::Get(profile)->extension_service(); 203 extensions::ExtensionSystem::Get(profile)->extension_service();
203 DCHECK(extension_service); 204 DCHECK(extension_service);
204 205
205 ExtensionPrefs::LaunchType launch_type = 206 ExtensionPrefs::LaunchType launch_type =
206 extension_service->extension_prefs()->GetLaunchType( 207 extension_service->extension_prefs()->GetLaunchType(
207 extension, ExtensionPrefs::LAUNCH_DEFAULT); 208 extension, ExtensionPrefs::LAUNCH_DEFAULT);
209 LOG(ERROR) << "LaunchType:" << launch_type;
stevenjb 2013/10/08 18:10:08 VLOG
208 UMA_HISTOGRAM_ENUMERATION("Extensions.AppTabLaunchType", launch_type, 100); 210 UMA_HISTOGRAM_ENUMERATION("Extensions.AppTabLaunchType", launch_type, 100);
209 211
210 int add_type = TabStripModel::ADD_ACTIVE; 212 int add_type = TabStripModel::ADD_ACTIVE;
211 if (launch_type == ExtensionPrefs::LAUNCH_PINNED) 213 if (launch_type == ExtensionPrefs::LAUNCH_PINNED)
212 add_type |= TabStripModel::ADD_PINNED; 214 add_type |= TabStripModel::ADD_PINNED;
213 215
214 GURL extension_url = UrlForExtension(extension, override_url); 216 GURL extension_url = UrlForExtension(extension, override_url);
215 chrome::NavigateParams params(browser, extension_url, 217 chrome::NavigateParams params(browser, extension_url,
216 content::PAGE_TRANSITION_AUTO_TOPLEVEL); 218 content::PAGE_TRANSITION_AUTO_TOPLEVEL);
217 params.tabstrip_add_types = add_type; 219 params.tabstrip_add_types = add_type;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 // OnDidGetApplicationInfo, which calls 417 // OnDidGetApplicationInfo, which calls
416 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as 418 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as
417 // pending web app action. 419 // pending web app action.
418 extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action( 420 extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action(
419 extensions::TabHelper::UPDATE_SHORTCUT); 421 extensions::TabHelper::UPDATE_SHORTCUT);
420 422
421 return tab; 423 return tab;
422 } 424 }
423 425
424 } // namespace chrome 426 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/search/webstore/webstore_result.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698