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

Side by Side Diff: chrome/browser/platform_util_chromeos.cc

Issue 18083022: Implement platform_util::OpenExternal on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/ui/apps/chrome_shell_window_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/platform_util.h" 5 #include "chrome/browser/platform_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" 8 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h"
9 #include "chrome/browser/profiles/profile_manager.h" 9 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/ui/browser_finder.h" 10 #include "chrome/browser/ui/browser_finder.h"
(...skipping 11 matching lines...) Expand all
22 "https://mail.google.com/mail/?extsrc=mailto&url="; 22 "https://mail.google.com/mail/?extsrc=mailto&url=";
23 23
24 void OpenURL(const std::string& url) { 24 void OpenURL(const std::string& url) {
25 // TODO(beng): improve this to locate context from call stack. 25 // TODO(beng): improve this to locate context from call stack.
26 Browser* browser = chrome::FindOrCreateTabbedBrowser( 26 Browser* browser = chrome::FindOrCreateTabbedBrowser(
27 ProfileManager::GetDefaultProfileOrOffTheRecord(), 27 ProfileManager::GetDefaultProfileOrOffTheRecord(),
28 chrome::HOST_DESKTOP_TYPE_ASH); 28 chrome::HOST_DESKTOP_TYPE_ASH);
29 chrome::NavigateParams params( 29 chrome::NavigateParams params(
30 browser, GURL(url), content::PAGE_TRANSITION_LINK); 30 browser, GURL(url), content::PAGE_TRANSITION_LINK);
31 params.disposition = NEW_FOREGROUND_TAB; 31 params.disposition = NEW_FOREGROUND_TAB;
32 params.window_action = chrome::NavigateParams::SHOW_WINDOW;
Ken Rockot(use gerrit already) 2013/07/01 20:16:18 Is there any reason why an explicit SHOW_WINDOW wo
sky 2013/07/02 00:35:42 Not that I can think of. In fact I suspect the old
32 chrome::Navigate(&params); 33 chrome::Navigate(&params);
33 } 34 }
34 35
35 } // namespace 36 } // namespace
36 37
37 namespace platform_util { 38 namespace platform_util {
38 39
39 void ShowItemInFolder(const base::FilePath& full_path) { 40 void ShowItemInFolder(const base::FilePath& full_path) {
40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 41 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
41 file_manager_util::ShowFileInFolder(full_path); 42 file_manager_util::ShowFileInFolder(full_path);
(...skipping 12 matching lines...) Expand all
54 // In this case we would need to have this in place. 55 // In this case we would need to have this in place.
55 // b.) There are several code paths which are not clear if they would call 56 // b.) There are several code paths which are not clear if they would call
56 // this function directly and which would therefore break (e.g. 57 // this function directly and which would therefore break (e.g.
57 // "Browser::EmailPageLocation" (to name only one). 58 // "Browser::EmailPageLocation" (to name only one).
58 // As such we should keep this code here. 59 // As such we should keep this code here.
59 if (url.SchemeIs("mailto")) { 60 if (url.SchemeIs("mailto")) {
60 std::string string_url = kGmailComposeUrl; 61 std::string string_url = kGmailComposeUrl;
61 string_url.append(url.spec()); 62 string_url.append(url.spec());
62 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 63 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
63 base::Bind(OpenURL, string_url)); 64 base::Bind(OpenURL, string_url));
65 } else if (url.is_valid()) {
sky 2013/07/02 00:35:42 What code is this being expected on? It seems like
sky 2013/07/02 00:35:55 That should be thread. Sorry.
Ken Rockot(use gerrit already) 2013/07/02 01:37:51 ExternalProtocolHandler does call OpenExternal fro
66 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
67 base::Bind(OpenURL, url.spec()));
64 } 68 }
65 } 69 }
66 70
67 } // namespace platform_util 71 } // namespace platform_util
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/apps/chrome_shell_window_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698