Index: chrome/browser/extensions/extension_host.cc |
=================================================================== |
--- chrome/browser/extensions/extension_host.cc (revision 191609) |
+++ chrome/browser/extensions/extension_host.cc (working copy) |
@@ -128,7 +128,7 @@ |
ExtensionHost::ExtensionHost(const Extension* extension, |
SiteInstance* site_instance, |
const GURL& url, |
- chrome::ViewType host_type) |
+ extensions::ViewType host_type) |
Yoyo Zhou
2013/04/01 17:36:51
''
|
: extension_(extension), |
extension_id_(extension->id()), |
profile_(Profile::FromBrowserContext( |
@@ -158,7 +158,7 @@ |
} |
ExtensionHost::~ExtensionHost() { |
- if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE && |
+ if (extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE && |
extension_ && BackgroundInfo::HasLazyBackgroundPage(extension_)) { |
UMA_HISTOGRAM_LONG_TIMES("Extensions.EventPageActiveTime", |
since_created_.Elapsed()); |
@@ -350,17 +350,18 @@ |
void ExtensionHost::DidStopLoading(content::RenderViewHost* render_view_host) { |
bool notify = !did_stop_loading_; |
did_stop_loading_ = true; |
- if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || |
- extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || |
- extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || |
- extension_host_type_ == chrome::VIEW_TYPE_PANEL) { |
+ if (extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_POPUP || |
+ extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_DIALOG || |
+ extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_INFOBAR || |
+ extension_host_type_ == extensions::VIEW_TYPE_PANEL) { |
#if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX) |
if (view()) |
view()->DidStopLoading(); |
#endif |
} |
if (notify) { |
- if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { |
+ if (extension_host_type_ == |
+ extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { |
if (extension_ && BackgroundInfo::HasLazyBackgroundPage(extension_)) { |
UMA_HISTOGRAM_TIMES("Extensions.EventPageLoadTime", |
since_created_.Elapsed()); |
@@ -368,16 +369,17 @@ |
UMA_HISTOGRAM_TIMES("Extensions.BackgroundPageLoadTime", |
since_created_.Elapsed()); |
} |
- } else if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG) { |
+ } else if (extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_DIALOG) { |
UMA_HISTOGRAM_TIMES("Extensions.DialogLoadTime", |
since_created_.Elapsed()); |
- } else if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP) { |
+ } else if (extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_POPUP) { |
UMA_HISTOGRAM_TIMES("Extensions.PopupLoadTime", |
since_created_.Elapsed()); |
- } else if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR) { |
+ } else if (extension_host_type_ == |
+ extensions::VIEW_TYPE_EXTENSION_INFOBAR) { |
UMA_HISTOGRAM_TIMES("Extensions.InfobarLoadTime", |
since_created_.Elapsed()); |
- } else if (extension_host_type_ == chrome::VIEW_TYPE_PANEL) { |
+ } else if (extension_host_type_ == extensions::VIEW_TYPE_PANEL) { |
UMA_HISTOGRAM_TIMES("Extensions.PanelLoadTime", since_created_.Elapsed()); |
} |
@@ -402,7 +404,7 @@ |
SetBackgroundPageReady(extension_); |
} else { |
switch (extension_host_type_) { |
- case chrome::VIEW_TYPE_EXTENSION_INFOBAR: |
+ case extensions::VIEW_TYPE_EXTENSION_INFOBAR: |
InsertInfobarCSS(); |
break; |
default: |
@@ -413,11 +415,11 @@ |
void ExtensionHost::CloseContents(WebContents* contents) { |
// TODO(mpcomplete): is this check really necessary? |
- if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || |
- extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || |
- extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || |
- extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || |
- extension_host_type_ == chrome::VIEW_TYPE_PANEL) { |
+ if (extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_POPUP || |
+ extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_DIALOG || |
+ extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || |
+ extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_INFOBAR || |
+ extension_host_type_ == extensions::VIEW_TYPE_PANEL) { |
Close(); |
} |
} |
@@ -460,7 +462,7 @@ |
bool ExtensionHost::PreHandleKeyboardEvent(WebContents* source, |
const NativeWebKeyboardEvent& event, |
bool* is_keyboard_shortcut) { |
- if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP && |
+ if (extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_POPUP && |
event.type == NativeWebKeyboardEvent::RawKeyDown && |
event.windowsKeyCode == ui::VKEY_ESCAPE) { |
DCHECK(is_keyboard_shortcut != NULL); |
@@ -479,7 +481,7 @@ |
void ExtensionHost::HandleKeyboardEvent(WebContents* source, |
const NativeWebKeyboardEvent& event) { |
- if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP) { |
+ if (extension_host_type_ == extensions::VIEW_TYPE_EXTENSION_POPUP) { |
if (event.type == NativeWebKeyboardEvent::RawKeyDown && |
event.windowsKeyCode == ui::VKEY_ESCAPE) { |
Close(); |