| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/message_box_flags.h" | 9 #include "app/message_box_flags.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 void AutomationProvider::AppendTab(int handle, const GURL& url, | 603 void AutomationProvider::AppendTab(int handle, const GURL& url, |
| 604 IPC::Message* reply_message) { | 604 IPC::Message* reply_message) { |
| 605 int append_tab_response = -1; // -1 is the error code | 605 int append_tab_response = -1; // -1 is the error code |
| 606 NotificationObserver* observer = NULL; | 606 NotificationObserver* observer = NULL; |
| 607 | 607 |
| 608 if (browser_tracker_->ContainsHandle(handle)) { | 608 if (browser_tracker_->ContainsHandle(handle)) { |
| 609 Browser* browser = browser_tracker_->GetResource(handle); | 609 Browser* browser = browser_tracker_->GetResource(handle); |
| 610 observer = AddTabStripObserver(browser, reply_message); | 610 observer = AddTabStripObserver(browser, reply_message); |
| 611 TabContents* tab_contents = browser->AddTabWithURL( | 611 TabContents* tab_contents = browser->AddTabWithURL( |
| 612 url, GURL(), PageTransition::TYPED, -1, TabStripModel::ADD_SELECTED, | 612 url, GURL(), PageTransition::TYPED, -1, TabStripModel::ADD_SELECTED, |
| 613 NULL, std::string()); | 613 NULL, std::string(), &browser); |
| 614 if (tab_contents) { | 614 if (tab_contents) { |
| 615 append_tab_response = | 615 append_tab_response = |
| 616 GetIndexForNavigationController(&tab_contents->controller(), browser); | 616 GetIndexForNavigationController(&tab_contents->controller(), browser); |
| 617 } | 617 } |
| 618 } | 618 } |
| 619 | 619 |
| 620 if (append_tab_response < 0) { | 620 if (append_tab_response < 0) { |
| 621 // The append tab failed. Remove the TabStripObserver | 621 // The append tab failed. Remove the TabStripObserver |
| 622 if (observer) { | 622 if (observer) { |
| 623 RemoveTabStripObserver(observer); | 623 RemoveTabStripObserver(observer); |
| (...skipping 3926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4550 } | 4550 } |
| 4551 | 4551 |
| 4552 void AutomationProvider::WaitForPopupMenuToOpen(IPC::Message* reply_message) { | 4552 void AutomationProvider::WaitForPopupMenuToOpen(IPC::Message* reply_message) { |
| 4553 NOTIMPLEMENTED(); | 4553 NOTIMPLEMENTED(); |
| 4554 } | 4554 } |
| 4555 #endif // !defined(TOOLKIT_VIEWS) | 4555 #endif // !defined(TOOLKIT_VIEWS) |
| 4556 | 4556 |
| 4557 void AutomationProvider::ResetToDefaultTheme() { | 4557 void AutomationProvider::ResetToDefaultTheme() { |
| 4558 profile_->ClearTheme(); | 4558 profile_->ClearTheme(); |
| 4559 } | 4559 } |
| OLD | NEW |