| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |