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

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

Issue 10917026: Switch Extensions::TabHelper to use WebContents, WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 8 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 | Annotate | Revision Log
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "chrome/browser/extensions/default_apps_trial.h" 10 #include "chrome/browser/extensions/default_apps_trial.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 WebContents* tab = OpenApplicationWindow( 275 WebContents* tab = OpenApplicationWindow(
276 profile, 276 profile,
277 NULL, // this is a URL app. No extension. 277 NULL, // this is a URL app. No extension.
278 extension_misc::LAUNCH_WINDOW, 278 extension_misc::LAUNCH_WINDOW,
279 url, 279 url,
280 &app_browser); 280 &app_browser);
281 281
282 if (!tab) 282 if (!tab)
283 return NULL; 283 return NULL;
284 284
285 TabContents* tab_contents = TabContents::FromWebContents(tab);
286 // Set UPDATE_SHORTCUT as the pending web app action. This action is picked 285 // Set UPDATE_SHORTCUT as the pending web app action. This action is picked
287 // up in LoadingStateChanged to schedule a GetApplicationInfo. And when 286 // up in LoadingStateChanged to schedule a GetApplicationInfo. And when
288 // the web app info is available, extensions::TabHelper notifies Browser via 287 // the web app info is available, extensions::TabHelper notifies Browser via
289 // OnDidGetApplicationInfo, which calls 288 // OnDidGetApplicationInfo, which calls
290 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as 289 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as
291 // pending web app action. 290 // pending web app action.
292 tab_contents->extension_tab_helper()->set_pending_web_app_action( 291 extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action(
293 extensions::TabHelper::UPDATE_SHORTCUT); 292 extensions::TabHelper::UPDATE_SHORTCUT);
294 293
295 return tab; 294 return tab;
296 } 295 }
297 296
298 } // namespace application_launch 297 } // namespace application_launch
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm ('k') | chrome/browser/ui/gtk/location_bar_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698