This source file includes following definitions.
- ShowDefault
- Show
- SetFactory
#include "chrome/browser/ui/translate/translate_bubble_factory.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
namespace {
void ShowDefault(BrowserWindow* window,
content::WebContents* web_contents,
TranslateTabHelper::TranslateStep step,
TranslateErrors::Type error_type) {
if (!window)
return;
window->ShowTranslateBubble(web_contents, step, error_type);
}
}
TranslateBubbleFactory::~TranslateBubbleFactory() {
}
void TranslateBubbleFactory::Show(BrowserWindow* window,
content::WebContents* web_contents,
TranslateTabHelper::TranslateStep step,
TranslateErrors::Type error_type) {
if (current_factory_) {
current_factory_->ShowImplementation(
window, web_contents, step, error_type);
return;
}
ShowDefault(window, web_contents, step, error_type);
}
void TranslateBubbleFactory::SetFactory(TranslateBubbleFactory* factory) {
current_factory_ = factory;
}
TranslateBubbleFactory* TranslateBubbleFactory::current_factory_ = NULL;