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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_util.cc

Issue 10391158: Moves methods for finding browsers to browser_finder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include fixs Created 8 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
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/chromeos/gdata/gdata_util.h" 5 #include "chrome/browser/chromeos/gdata/gdata_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "chrome/common/chrome_version_info.h" 21 #include "chrome/common/chrome_version_info.h"
22 #include "chrome/common/pref_names.h" 22 #include "chrome/common/pref_names.h"
23 #include "chrome/common/url_constants.h" 23 #include "chrome/common/url_constants.h"
24 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" 24 #include "chrome/browser/chromeos/gdata/gdata_file_system.h"
25 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" 25 #include "chrome/browser/chromeos/gdata/gdata_system_service.h"
26 #include "chrome/browser/chromeos/login/user.h" 26 #include "chrome/browser/chromeos/login/user.h"
27 #include "chrome/browser/chromeos/login/user_manager.h" 27 #include "chrome/browser/chromeos/login/user_manager.h"
28 #include "chrome/browser/prefs/pref_service.h" 28 #include "chrome/browser/prefs/pref_service.h"
29 #include "chrome/browser/profiles/profile.h" 29 #include "chrome/browser/profiles/profile.h"
30 #include "chrome/browser/ui/browser.h" 30 #include "chrome/browser/ui/browser.h"
31 #include "chrome/browser/ui/browser_list.h" 31 #include "chrome/browser/ui/browser_finder.h"
32 #include "content/public/browser/browser_thread.h" 32 #include "content/public/browser/browser_thread.h"
33 #include "content/public/browser/child_process_security_policy.h" 33 #include "content/public/browser/child_process_security_policy.h"
34 #include "net/base/escape.h" 34 #include "net/base/escape.h"
35 #include "third_party/libxml/chromium/libxml_utils.h" 35 #include "third_party/libxml/chromium/libxml_utils.h"
36 36
37 namespace gdata { 37 namespace gdata {
38 namespace util { 38 namespace util {
39 39
40 namespace { 40 namespace {
41 41
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 std::string edit_url; 79 std::string edit_url;
80 if (!dict_val->GetString("url", &edit_url)) { 80 if (!dict_val->GetString("url", &edit_url)) {
81 NOTREACHED() << "url field doesn't exist in " << json; 81 NOTREACHED() << "url field doesn't exist in " << json;
82 return; 82 return;
83 } 83 }
84 *url = GURL(edit_url); 84 *url = GURL(edit_url);
85 DVLOG(1) << "edit url " << *url; 85 DVLOG(1) << "edit url " << *url;
86 } 86 }
87 87
88 void OpenEditURLUIThread(Profile* profile, GURL* edit_url) { 88 void OpenEditURLUIThread(Profile* profile, GURL* edit_url) {
89 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); 89 Browser* browser = browser::FindLastActiveWithProfile(profile);
90 if (browser) { 90 if (browser) {
91 browser->OpenURL(content::OpenURLParams(*edit_url, content::Referrer(), 91 browser->OpenURL(content::OpenURLParams(*edit_url, content::Referrer(),
92 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); 92 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
93 } 93 }
94 } 94 }
95 95
96 } // namespace 96 } // namespace
97 97
98 const FilePath& GetGDataMountPointPath() { 98 const FilePath& GetGDataMountPointPath() {
99 CR_DEFINE_STATIC_LOCAL(FilePath, gdata_mount_path, 99 CR_DEFINE_STATIC_LOCAL(FilePath, gdata_mount_path,
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 // Assign the extracted extensions to md5 and extra_extension. 351 // Assign the extracted extensions to md5 and extra_extension.
352 int extension_count = extensions.size(); 352 int extension_count = extensions.size();
353 *md5 = (extension_count > 0) ? extensions[extension_count - 1] : 353 *md5 = (extension_count > 0) ? extensions[extension_count - 1] :
354 std::string(); 354 std::string();
355 *extra_extension = (extension_count > 1) ? extensions[extension_count - 2] : 355 *extra_extension = (extension_count > 1) ? extensions[extension_count - 2] :
356 std::string(); 356 std::string();
357 } 357 }
358 358
359 } // namespace util 359 } // namespace util
360 } // namespace gdata 360 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698