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 24 matching lines...) Expand all Loading... |
35 #include "chrome/browser/profiles/profile.h" | 35 #include "chrome/browser/profiles/profile.h" |
36 #include "chrome/browser/translate/translate_tab_helper.h" | 36 #include "chrome/browser/translate/translate_tab_helper.h" |
37 #include "chrome/browser/ui/browser.h" | 37 #include "chrome/browser/ui/browser.h" |
38 #include "chrome/browser/ui/browser_commands.h" | 38 #include "chrome/browser/ui/browser_commands.h" |
39 #include "chrome/browser/ui/browser_finder.h" | 39 #include "chrome/browser/ui/browser_finder.h" |
40 #include "chrome/browser/ui/browser_list.h" | 40 #include "chrome/browser/ui/browser_list.h" |
41 #include "chrome/browser/ui/browser_navigator.h" | 41 #include "chrome/browser/ui/browser_navigator.h" |
42 #include "chrome/browser/ui/browser_tabstrip.h" | 42 #include "chrome/browser/ui/browser_tabstrip.h" |
43 #include "chrome/browser/ui/browser_window.h" | 43 #include "chrome/browser/ui/browser_window.h" |
44 #include "chrome/browser/ui/extensions/shell_window.h" | 44 #include "chrome/browser/ui/extensions/shell_window.h" |
| 45 #include "chrome/browser/ui/host_desktop.h" |
45 #include "chrome/browser/ui/panels/panel_manager.h" | 46 #include "chrome/browser/ui/panels/panel_manager.h" |
46 #include "chrome/browser/ui/snapshot_tab_helper.h" | 47 #include "chrome/browser/ui/snapshot_tab_helper.h" |
47 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 48 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
48 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 49 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
49 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 50 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
50 #include "chrome/browser/web_applications/web_app.h" | 51 #include "chrome/browser/web_applications/web_app.h" |
51 #include "chrome/common/chrome_notification_types.h" | 52 #include "chrome/common/chrome_notification_types.h" |
52 #include "chrome/common/chrome_switches.h" | 53 #include "chrome/common/chrome_switches.h" |
53 #include "chrome/common/extensions/api/windows.h" | 54 #include "chrome/common/extensions/api/windows.h" |
54 #include "chrome/common/extensions/extension.h" | 55 #include "chrome/common/extensions/extension.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // In windows 8 metro mode we don't allow windows to be created. | 231 // In windows 8 metro mode we don't allow windows to be created. |
231 if (base::win::IsMetroProcess()) | 232 if (base::win::IsMetroProcess()) |
232 use_existing_browser_window = true; | 233 use_existing_browser_window = true; |
233 #endif // OS_WIN | 234 #endif // OS_WIN |
234 | 235 |
235 Browser* new_window = NULL; | 236 Browser* new_window = NULL; |
236 if (use_existing_browser_window) | 237 if (use_existing_browser_window) |
237 // The false parameter passed below is to ensure that we find a browser | 238 // The false parameter passed below is to ensure that we find a browser |
238 // object matching the profile passed in, instead of the original profile | 239 // object matching the profile passed in, instead of the original profile |
239 new_window = browser::FindTabbedBrowser( | 240 new_window = browser::FindTabbedBrowser( |
240 profile, false, params.host_desktop_type); | 241 profile, false, chrome::GetActiveDesktop()); |
241 | 242 |
242 if (!new_window) | 243 if (!new_window) |
243 new_window = new Browser(params); | 244 new_window = new Browser(params); |
244 return new_window; | 245 return new_window; |
245 } | 246 } |
246 | 247 |
247 } // namespace | 248 } // namespace |
248 | 249 |
249 // Windows --------------------------------------------------------------------- | 250 // Windows --------------------------------------------------------------------- |
250 | 251 |
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 // called for every API call the extension made. | 1870 // called for every API call the extension made. |
1870 GotLanguage(language); | 1871 GotLanguage(language); |
1871 } | 1872 } |
1872 | 1873 |
1873 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1874 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
1874 SetResult(Value::CreateStringValue(language.c_str())); | 1875 SetResult(Value::CreateStringValue(language.c_str())); |
1875 SendResponse(true); | 1876 SendResponse(true); |
1876 | 1877 |
1877 Release(); // Balanced in Run() | 1878 Release(); // Balanced in Run() |
1878 } | 1879 } |
OLD | NEW |