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

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs.cc

Issue 10560015: Implement base::win::IsMetroProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Ananta's comments. Created 8 years, 6 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/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
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::InMetroMode())
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698