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

Side by Side Diff: chrome/browser/apps/install_chrome_app.cc

Issue 276263004: --install-chrome-app opens new tab in existing window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/apps/install_chrome_app.h" 5 #include "chrome/browser/apps/install_chrome_app.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 void NavigateToUrlWithAccountsReferrer(const GURL& url) { 36 void NavigateToUrlWithAccountsReferrer(const GURL& url) {
37 Browser* browser = 37 Browser* browser =
38 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->get(0); 38 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->get(0);
39 if (!browser) 39 if (!browser)
40 return; 40 return;
41 41
42 chrome::NavigateParams params( 42 chrome::NavigateParams params(
43 browser, url, content::PAGE_TRANSITION_AUTO_TOPLEVEL); 43 browser, url, content::PAGE_TRANSITION_AUTO_TOPLEVEL);
44 params.disposition = NEW_FOREGROUND_TAB;
44 params.window_action = chrome::NavigateParams::SHOW_WINDOW; 45 params.window_action = chrome::NavigateParams::SHOW_WINDOW;
45 params.referrer = content::Referrer(); 46 params.referrer = content::Referrer();
46 params.referrer.url = GURL(kAccountsUrl); 47 params.referrer.url = GURL(kAccountsUrl);
47 chrome::Navigate(&params); 48 chrome::Navigate(&params);
48 } 49 }
49 50
50 class AppURLFetcher : net::URLFetcherDelegate { 51 class AppURLFetcher : net::URLFetcherDelegate {
51 public: 52 public:
52 explicit AppURLFetcher(const std::string& app_id); 53 explicit AppURLFetcher(const std::string& app_id);
53 54
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 namespace install_chrome_app { 88 namespace install_chrome_app {
88 89
89 void InstallChromeApp(const std::string& app_id) { 90 void InstallChromeApp(const std::string& app_id) {
90 if (!extensions::Extension::IdIsValid(app_id)) 91 if (!extensions::Extension::IdIsValid(app_id))
91 return; 92 return;
92 93
93 new AppURLFetcher(app_id); 94 new AppURLFetcher(app_id);
94 } 95 }
95 96
96 } // namespace install_chrome_app 97 } // namespace install_chrome_app
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698