| 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/extensions/api/tabs/tabs.h" | 5 #include "chrome/browser/extensions/api/tabs/tabs.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 } | 220 } |
| 221 | 221 |
| 222 Browser* CreateBrowserWindow(const Browser::CreateParams& params, | 222 Browser* CreateBrowserWindow(const Browser::CreateParams& params, |
| 223 Profile* profile, | 223 Profile* profile, |
| 224 const std::string& extension_id) { | 224 const std::string& extension_id) { |
| 225 bool use_existing_browser_window = false; | 225 bool use_existing_browser_window = false; |
| 226 | 226 |
| 227 #if defined(OS_WIN) | 227 #if defined(OS_WIN) |
| 228 // In Windows 8 metro mode we only allow new windows to be created if the | 228 // In Windows 8 metro mode we only allow new windows to be created if the |
| 229 // extension id is valid in which case it is created as an application window | 229 // extension id is valid in which case it is created as an application window |
| 230 if (extension_id.empty() && base::win::GetMetroModule()) | 230 if (extension_id.empty() && base::win::IsMetroProcess()) |
| 231 use_existing_browser_window = true; | 231 use_existing_browser_window = true; |
| 232 #endif // OS_WIN | 232 #endif // OS_WIN |
| 233 | 233 |
| 234 Browser* new_window = NULL; | 234 Browser* new_window = NULL; |
| 235 if (use_existing_browser_window) | 235 if (use_existing_browser_window) |
| 236 // The false parameter passed below is to ensure that we find a browser | 236 // The false parameter passed below is to ensure that we find a browser |
| 237 // object matching the profile passed in, instead of the original profile | 237 // object matching the profile passed in, instead of the original profile |
| 238 new_window = browser::FindTabbedBrowser(profile, false); | 238 new_window = browser::FindTabbedBrowser(profile, false); |
| 239 | 239 |
| 240 if (!new_window) | 240 if (!new_window) |
| (...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1824 // called for every API call the extension made. | 1824 // called for every API call the extension made. |
| 1825 GotLanguage(language); | 1825 GotLanguage(language); |
| 1826 } | 1826 } |
| 1827 | 1827 |
| 1828 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1828 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
| 1829 result_.reset(Value::CreateStringValue(language.c_str())); | 1829 result_.reset(Value::CreateStringValue(language.c_str())); |
| 1830 SendResponse(true); | 1830 SendResponse(true); |
| 1831 | 1831 |
| 1832 Release(); // Balanced in Run() | 1832 Release(); // Balanced in Run() |
| 1833 } | 1833 } |
| OLD | NEW |