| OLD | NEW |
| 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/automation/automation_util.h" | 5 #include "chrome/browser/automation/automation_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 23 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/sessions/session_id.h" | 25 #include "chrome/browser/sessions/session_id.h" |
| 26 #include "chrome/browser/sessions/session_tab_helper.h" | 26 #include "chrome/browser/sessions/session_tab_helper.h" |
| 27 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 27 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
| 28 #include "chrome/browser/ui/browser.h" | 28 #include "chrome/browser/ui/browser.h" |
| 29 #include "chrome/browser/ui/browser_iterator.h" | 29 #include "chrome/browser/ui/browser_iterator.h" |
| 30 #include "chrome/browser/ui/browser_list.h" | 30 #include "chrome/browser/ui/browser_list.h" |
| 31 #include "chrome/browser/ui/host_desktop.h" | 31 #include "chrome/browser/ui/host_desktop.h" |
| 32 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 32 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 33 #include "chrome/browser/view_type_utils.h" | |
| 34 #include "chrome/common/automation_id.h" | 33 #include "chrome/common/automation_id.h" |
| 35 #include "chrome/common/extensions/extension.h" | 34 #include "chrome/common/extensions/extension.h" |
| 36 #include "content/public/browser/browser_thread.h" | 35 #include "content/public/browser/browser_thread.h" |
| 37 #include "content/public/browser/render_process_host.h" | 36 #include "content/public/browser/render_process_host.h" |
| 38 #include "content/public/browser/render_view_host.h" | 37 #include "content/public/browser/render_view_host.h" |
| 39 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
| 39 #include "extensions/browser/view_type_utils.h" |
| 40 #include "net/cookies/canonical_cookie.h" | 40 #include "net/cookies/canonical_cookie.h" |
| 41 #include "net/cookies/cookie_monster.h" | 41 #include "net/cookies/cookie_monster.h" |
| 42 #include "net/cookies/cookie_store.h" | 42 #include "net/cookies/cookie_store.h" |
| 43 #include "net/url_request/url_request_context.h" | 43 #include "net/url_request/url_request_context.h" |
| 44 #include "net/url_request/url_request_context_getter.h" | 44 #include "net/url_request/url_request_context_getter.h" |
| 45 | 45 |
| 46 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
| 47 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 47 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 48 #include "chrome/browser/chromeos/login/login_display.h" | 48 #include "chrome/browser/chromeos/login/login_display.h" |
| 49 #include "chrome/browser/chromeos/login/login_display_host.h" | 49 #include "chrome/browser/chromeos/login/login_display_host.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 const SessionTabHelper* session_tab_helper = | 463 const SessionTabHelper* session_tab_helper = |
| 464 SessionTabHelper::FromWebContents(tab); | 464 SessionTabHelper::FromWebContents(tab); |
| 465 return AutomationId(AutomationId::kTypeTab, | 465 return AutomationId(AutomationId::kTypeTab, |
| 466 base::IntToString(session_tab_helper->session_id().id())); | 466 base::IntToString(session_tab_helper->session_id().id())); |
| 467 } | 467 } |
| 468 | 468 |
| 469 AutomationId GetIdForExtensionView( | 469 AutomationId GetIdForExtensionView( |
| 470 const content::RenderViewHost* render_view_host) { | 470 const content::RenderViewHost* render_view_host) { |
| 471 AutomationId::Type type; | 471 AutomationId::Type type; |
| 472 WebContents* web_contents = WebContents::FromRenderViewHost(render_view_host); | 472 WebContents* web_contents = WebContents::FromRenderViewHost(render_view_host); |
| 473 switch (chrome::GetViewType(web_contents)) { | 473 switch (extensions::GetViewType(web_contents)) { |
| 474 case chrome::VIEW_TYPE_EXTENSION_POPUP: | 474 case extensions::VIEW_TYPE_EXTENSION_POPUP: |
| 475 type = AutomationId::kTypeExtensionPopup; | 475 type = AutomationId::kTypeExtensionPopup; |
| 476 break; | 476 break; |
| 477 case chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: | 477 case extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: |
| 478 type = AutomationId::kTypeExtensionBgPage; | 478 type = AutomationId::kTypeExtensionBgPage; |
| 479 break; | 479 break; |
| 480 case chrome::VIEW_TYPE_EXTENSION_INFOBAR: | 480 case extensions::VIEW_TYPE_EXTENSION_INFOBAR: |
| 481 type = AutomationId::kTypeExtensionInfobar; | 481 type = AutomationId::kTypeExtensionInfobar; |
| 482 break; | 482 break; |
| 483 case chrome::VIEW_TYPE_APP_SHELL: | 483 case extensions::VIEW_TYPE_APP_SHELL: |
| 484 type = AutomationId::kTypeAppShell; | 484 type = AutomationId::kTypeAppShell; |
| 485 break; | 485 break; |
| 486 default: | 486 default: |
| 487 type = AutomationId::kTypeInvalid; | 487 type = AutomationId::kTypeInvalid; |
| 488 break; | 488 break; |
| 489 } | 489 } |
| 490 // Since these extension views do not permit navigation, using the | 490 // Since these extension views do not permit navigation, using the |
| 491 // renderer process and view ID should suffice. | 491 // renderer process and view ID should suffice. |
| 492 std::string id = base::StringPrintf("%d|%d", | 492 std::string id = base::StringPrintf("%d|%d", |
| 493 render_view_host->GetRoutingID(), | 493 render_view_host->GetRoutingID(), |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 const extensions::Extension* extension; | 619 const extensions::Extension* extension; |
| 620 return GetExtensionForId(id, profile, &extension); | 620 return GetExtensionForId(id, profile, &extension); |
| 621 } | 621 } |
| 622 default: | 622 default: |
| 623 break; | 623 break; |
| 624 } | 624 } |
| 625 return false; | 625 return false; |
| 626 } | 626 } |
| 627 | 627 |
| 628 } // namespace automation_util | 628 } // namespace automation_util |
| OLD | NEW |