OLD | NEW |
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 Loading... |
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(¶ms); | 48 chrome::Navigate(¶ms); |
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 Loading... |
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 |
OLD | NEW |