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

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

Issue 13375017: Move the ViewType enum to extensions\common. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 (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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (chrome::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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698