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

Unified Diff: chrome/browser/ui/translate/translate_bubble_factory.cc

Issue 25373009: Translate: New Bubble UX (for the view toolkit) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix: view id on tests Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/translate/translate_bubble_factory.h ('k') | chrome/browser/ui/view_ids.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/translate/translate_bubble_factory.cc
diff --git a/chrome/browser/ui/translate/translate_bubble_factory.cc b/chrome/browser/ui/translate/translate_bubble_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8f0bd27c24534b79b55cfe7adf6c9d9181823bb0
--- /dev/null
+++ b/chrome/browser/ui/translate/translate_bubble_factory.cc
@@ -0,0 +1,44 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#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,
+ TranslateBubbleModel::ViewState view_state) {
+ // |window| might be null when testing.
+ if (!window)
+ return;
+ window->ShowTranslateBubble(web_contents, view_state);
+}
+
+} // namespace
+
+TranslateBubbleFactory::~TranslateBubbleFactory() {
+}
+
+// static
+void TranslateBubbleFactory::Show(BrowserWindow* window,
+ content::WebContents* web_contents,
+ TranslateBubbleModel::ViewState view_state) {
+ if (current_factory_) {
+ current_factory_->ShowImplementation(window, web_contents, view_state);
+ return;
+ }
+
+ ShowDefault(window, web_contents, view_state);
+}
+
+// static
+void TranslateBubbleFactory::SetFactory(TranslateBubbleFactory* factory) {
+ current_factory_ = factory;
+}
+
+// static
+TranslateBubbleFactory* TranslateBubbleFactory::current_factory_ = NULL;
« no previous file with comments | « chrome/browser/ui/translate/translate_bubble_factory.h ('k') | chrome/browser/ui/view_ids.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698