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

Side by Side Diff: chrome/browser/extensions/platform_app_launcher.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 | 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/extensions/platform_app_launcher.h" 5 #include "chrome/browser/extensions/platform_app_launcher.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 private: 140 private:
141 friend class base::RefCountedThreadSafe<PlatformAppPathLauncher>; 141 friend class base::RefCountedThreadSafe<PlatformAppPathLauncher>;
142 142
143 virtual ~PlatformAppPathLauncher() {} 143 virtual ~PlatformAppPathLauncher() {}
144 144
145 void GetMimeTypeAndLaunch() { 145 void GetMimeTypeAndLaunch() {
146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
147 147
148 // If the file doesn't exist, or is a directory, launch with no launch data. 148 // If the file doesn't exist, or is a directory, launch with no launch data.
149 if (!file_util::PathExists(file_path_) || 149 if (!base::PathExists(file_path_) ||
150 file_util::DirectoryExists(file_path_)) { 150 file_util::DirectoryExists(file_path_)) {
151 LOG(WARNING) << "No file exists with path " << file_path_.value(); 151 LOG(WARNING) << "No file exists with path " << file_path_.value();
152 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( 152 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
153 &PlatformAppPathLauncher::LaunchWithNoLaunchData, this)); 153 &PlatformAppPathLauncher::LaunchWithNoLaunchData, this));
154 return; 154 return;
155 } 155 }
156 156
157 std::string mime_type; 157 std::string mime_type;
158 if (!net::GetMimeTypeFromFile(file_path_, &mime_type)) 158 if (!net::GetMimeTypeFromFile(file_path_, &mime_type))
159 mime_type = kFallbackMimeType; 159 mime_type = kFallbackMimeType;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 bool had_windows = extension_prefs->IsActive(extension->id()); 346 bool had_windows = extension_prefs->IsActive(extension->id());
347 extension_prefs->SetIsActive(extension->id(), false); 347 extension_prefs->SetIsActive(extension->id(), false);
348 bool listening_to_launch = event_router-> 348 bool listening_to_launch = event_router->
349 ExtensionHasEventListener(extension->id(), event_names::kOnLaunched); 349 ExtensionHasEventListener(extension->id(), event_names::kOnLaunched);
350 350
351 if (listening_to_launch && had_windows) 351 if (listening_to_launch && had_windows)
352 LaunchPlatformAppWithNoData(profile, extension); 352 LaunchPlatformAppWithNoData(profile, extension);
353 } 353 }
354 354
355 } // namespace extensions 355 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_registry_loader_win.cc ('k') | chrome/browser/extensions/sandboxed_unpacker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698