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

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

Issue 10896: Re-do the way browser windows are shown:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/path_service.h" 7 #include "base/path_service.h"
8 #include "chrome/app/chrome_dll_resource.h" 8 #include "chrome/app/chrome_dll_resource.h"
9 #include "chrome/browser/automation/automation_provider_list.h" 9 #include "chrome/browser/automation/automation_provider_list.h"
10 #include "chrome/browser/automation/ui_controls.h" 10 #include "chrome/browser/automation/ui_controls.h"
(...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after
1947 download_directory = dlm->download_path(); 1947 download_directory = dlm->download_path();
1948 } 1948 }
1949 1949
1950 Send(new AutomationMsg_DownloadDirectoryResponse(message.routing_id(), 1950 Send(new AutomationMsg_DownloadDirectoryResponse(message.routing_id(),
1951 download_directory)); 1951 download_directory));
1952 } 1952 }
1953 1953
1954 void AutomationProvider::OpenNewBrowserWindow(int show_command) { 1954 void AutomationProvider::OpenNewBrowserWindow(int show_command) {
1955 // We may have no current browser windows open so don't rely on 1955 // We may have no current browser windows open so don't rely on
1956 // asking an existing browser to execute the IDC_NEWWINDOW command 1956 // asking an existing browser to execute the IDC_NEWWINDOW command
1957 Browser::OpenNewBrowserWindow(profile_, show_command); 1957 Browser* browser = Browser::Create(profile_);
1958 browser->AddBlankTab(true);
1959 if (show_command != SW_HIDE)
1960 browser->window()->Show();
1958 } 1961 }
1959 1962
1960 void AutomationProvider::GetWindowForBrowser(const IPC::Message& message, 1963 void AutomationProvider::GetWindowForBrowser(const IPC::Message& message,
1961 int browser_handle) { 1964 int browser_handle) {
1962 bool success = false; 1965 bool success = false;
1963 int window_handle = 0; 1966 int window_handle = 0;
1964 1967
1965 if (browser_tracker_->ContainsHandle(browser_handle)) { 1968 if (browser_tracker_->ContainsHandle(browser_handle)) {
1966 Browser* browser = browser_tracker_->GetResource(browser_handle); 1969 Browser* browser = browser_tracker_->GetResource(browser_handle);
1967 HWND hwnd = browser->GetTopLevelHWND(); 1970 HWND hwnd = browser->GetTopLevelHWND();
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
2524 int value) { 2527 int value) {
2525 bool success = false; 2528 bool success = false;
2526 if (browser_tracker_->ContainsHandle(handle)) { 2529 if (browser_tracker_->ContainsHandle(handle)) {
2527 Browser* browser = browser_tracker_->GetResource(handle); 2530 Browser* browser = browser_tracker_->GetResource(handle);
2528 browser->profile()->GetPrefs()->SetInteger(name.c_str(), value); 2531 browser->profile()->GetPrefs()->SetInteger(name.c_str(), value);
2529 success = true; 2532 success = true;
2530 } 2533 }
2531 Send(new AutomationMsg_SetIntPreferenceResponse(message.routing_id(), 2534 Send(new AutomationMsg_SetIntPreferenceResponse(message.routing_id(),
2532 success)); 2535 success));
2533 } 2536 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698