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

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 #if !defined(OS_CHROMEOS) && !defined(OS_MACOSX) 288 #if !defined(OS_CHROMEOS) && !defined(OS_MACOSX)
289 // For backwards compatibility with the testing automation interface, we 289 // For backwards compatibility with the testing automation interface, we
290 // want the automation provider (and hence the process) to go away when the 290 // want the automation provider (and hence the process) to go away when the
291 // last browser goes away. 291 // last browser goes away.
292 // The automation layer doesn't support non-native desktops. 292 // The automation layer doesn't support non-native desktops.
293 if (BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty() && 293 if (BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty() &&
294 !CommandLine::ForCurrentProcess()->HasSwitch( 294 !CommandLine::ForCurrentProcess()->HasSwitch(
295 switches::kKeepAliveForTest)) { 295 switches::kKeepAliveForTest)) {
296 // If you change this, update Observer for chrome::SESSION_END 296 // If you change this, update Observer for chrome::SESSION_END
297 // below. 297 // below.
298 MessageLoop::current()->PostTask( 298 base::MessageLoop::current()->PostTask(
299 FROM_HERE, 299 FROM_HERE,
300 base::Bind(&TestingAutomationProvider::OnRemoveProvider, this)); 300 base::Bind(&TestingAutomationProvider::OnRemoveProvider, this));
301 } 301 }
302 #endif // !defined(OS_CHROMEOS) && !defined(OS_MACOSX) 302 #endif // !defined(OS_CHROMEOS) && !defined(OS_MACOSX)
303 } 303 }
304 304
305 void TestingAutomationProvider::OnSourceProfilesLoaded() { 305 void TestingAutomationProvider::OnSourceProfilesLoaded() {
306 DCHECK_NE(static_cast<ImporterList*>(NULL), importer_list_.get()); 306 DCHECK_NE(static_cast<ImporterList*>(NULL), importer_list_.get());
307 307
308 // Get the correct profile based on the browser that the user provided. 308 // Get the correct profile based on the browser that the user provided.
(...skipping 5381 matching lines...) Expand 10 before | Expand all | Expand 10 after
5690 if (g_browser_process) 5690 if (g_browser_process)
5691 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 5691 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
5692 } 5692 }
5693 5693
5694 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 5694 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
5695 WebContents* tab) { 5695 WebContents* tab) {
5696 TabStripModel* tab_strip = browser->tab_strip_model(); 5696 TabStripModel* tab_strip = browser->tab_strip_model();
5697 if (tab_strip->GetActiveWebContents() != tab) 5697 if (tab_strip->GetActiveWebContents() != tab)
5698 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); 5698 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true);
5699 } 5699 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698