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

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

Issue 7648053: [chromedriver] Add chrome.detach option for configuring Chrome not to quit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use switch and rebase Created 9 years, 4 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
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/automation_provider.h" 5 #include "chrome/browser/automation/automation_provider.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 11 #include "base/debug/trace_event.h"
11 #include "base/file_path.h" 12 #include "base/file_path.h"
12 #include "base/json/json_reader.h" 13 #include "base/json/json_reader.h"
13 #include "base/json/json_writer.h" 14 #include "base/json/json_writer.h"
14 #include "base/json/string_escape.h" 15 #include "base/json/string_escape.h"
15 #include "base/message_loop.h" 16 #include "base/message_loop.h"
16 #include "base/path_service.h" 17 #include "base/path_service.h"
17 #include "base/process_util.h" 18 #include "base/process_util.h"
18 #include "base/stl_util.h" 19 #include "base/stl_util.h"
19 #include "base/string_number_conversions.h" 20 #include "base/string_number_conversions.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 browser_tracker_.reset(new AutomationBrowserTracker(this)); 117 browser_tracker_.reset(new AutomationBrowserTracker(this));
117 extension_tracker_.reset(new AutomationExtensionTracker(this)); 118 extension_tracker_.reset(new AutomationExtensionTracker(this));
118 tab_tracker_.reset(new AutomationTabTracker(this)); 119 tab_tracker_.reset(new AutomationTabTracker(this));
119 window_tracker_.reset(new AutomationWindowTracker(this)); 120 window_tracker_.reset(new AutomationWindowTracker(this));
120 new_tab_ui_load_observer_.reset(new NewTabUILoadObserver(this, profile)); 121 new_tab_ui_load_observer_.reset(new NewTabUILoadObserver(this, profile));
121 metric_event_duration_observer_.reset(new MetricEventDurationObserver()); 122 metric_event_duration_observer_.reset(new MetricEventDurationObserver());
122 extension_test_result_observer_.reset( 123 extension_test_result_observer_.reset(
123 new ExtensionTestResultNotificationObserver(this)); 124 new ExtensionTestResultNotificationObserver(this));
124 g_browser_process->AddRefModule(); 125 g_browser_process->AddRefModule();
125 126
127 if (CommandLine::ForCurrentProcess()->HasSwitch(
Paweł Hajdan Jr. 2011/08/18 22:35:42 Rather: reinitialize_on_channel_error_(CommandLine
128 switches::kAutomationReinitializeOnChannelError))
129 reinitialize_on_channel_error_ = true;
130
126 TRACE_EVENT_END_ETW("AutomationProvider::AutomationProvider", 0, ""); 131 TRACE_EVENT_END_ETW("AutomationProvider::AutomationProvider", 0, "");
127 } 132 }
128 133
129 AutomationProvider::~AutomationProvider() { 134 AutomationProvider::~AutomationProvider() {
130 if (channel_.get()) 135 if (channel_.get())
131 channel_->Close(); 136 channel_->Close();
132 137
133 g_browser_process->ReleaseModule(); 138 g_browser_process->ReleaseModule();
134 } 139 }
135 140
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 } 946 }
942 } 947 }
943 } 948 }
944 949
945 void AutomationProvider::SaveAsAsync(int tab_handle) { 950 void AutomationProvider::SaveAsAsync(int tab_handle) {
946 NavigationController* tab = NULL; 951 NavigationController* tab = NULL;
947 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); 952 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab);
948 if (tab_contents) 953 if (tab_contents)
949 tab_contents->OnSavePage(); 954 tab_contents->OnSavePage();
950 } 955 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698