OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/file_manager/open_with_browser.h" | 5 #include "chrome/browser/chromeos/file_manager/open_with_browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 void OpenNewTab(Profile* profile, const GURL& url) { | 109 void OpenNewTab(Profile* profile, const GURL& url) { |
110 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 110 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
111 | 111 |
112 // Check the validity of the pointer so that the closure from | 112 // Check the validity of the pointer so that the closure from |
113 // base::Bind(&OpenNewTab, profile) can be passed between threads. | 113 // base::Bind(&OpenNewTab, profile) can be passed between threads. |
114 if (!g_browser_process->profile_manager()->IsValidProfile(profile)) | 114 if (!g_browser_process->profile_manager()->IsValidProfile(profile)) |
115 return; | 115 return; |
116 | 116 |
117 chrome::ScopedTabbedBrowserDisplayer displayer( | 117 chrome::ScopedTabbedBrowserDisplayer displayer(profile); |
118 profile, chrome::HOST_DESKTOP_TYPE_ASH); | |
119 chrome::AddSelectedTabWithURL(displayer.browser(), url, | 118 chrome::AddSelectedTabWithURL(displayer.browser(), url, |
120 ui::PAGE_TRANSITION_LINK); | 119 ui::PAGE_TRANSITION_LINK); |
121 | 120 |
122 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the | 121 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the |
123 // browser will be shown on the active desktop, we ensure the visibility. | 122 // browser will be shown on the active desktop, we ensure the visibility. |
124 multi_user_util::MoveWindowToCurrentDesktop( | 123 multi_user_util::MoveWindowToCurrentDesktop( |
125 displayer.browser()->window()->GetNativeWindow()); | 124 displayer.browser()->window()->GetNativeWindow()); |
126 } | 125 } |
127 | 126 |
128 // Reads the alternate URL from a GDoc file. When it fails, returns a file URL | 127 // Reads the alternate URL from a GDoc file. When it fails, returns a file URL |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); | 193 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); |
195 if (file_path.MatchesExtension(kPdfExtension)) | 194 if (file_path.MatchesExtension(kPdfExtension)) |
196 return IsPdfPluginEnabled(profile); | 195 return IsPdfPluginEnabled(profile); |
197 if (file_path.MatchesExtension(kSwfExtension)) | 196 if (file_path.MatchesExtension(kSwfExtension)) |
198 return IsFlashPluginEnabled(profile); | 197 return IsFlashPluginEnabled(profile); |
199 return false; | 198 return false; |
200 } | 199 } |
201 | 200 |
202 } // namespace util | 201 } // namespace util |
203 } // namespace file_manager | 202 } // namespace file_manager |
OLD | NEW |