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

Side by Side 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: Sky's review (3) Created 7 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/translate/translate_bubble_factory.h"
6
7 #include "chrome/browser/ui/browser_finder.h"
8 #include "chrome/browser/ui/browser_window.h"
9
10 namespace {
11
12 void ShowDefault(BrowserWindow* window,
13 content::WebContents* web_contents,
14 TranslateBubbleModel::ViewState view_state) {
15 // |window| might be null when testing.
16 if (!window)
17 return;
18 window->ShowTranslateBubble(web_contents, view_state);
19 }
20
21 } // namespace
22
23 TranslateBubbleFactory::~TranslateBubbleFactory() {
24 }
25
26 // static
27 void TranslateBubbleFactory::Show(BrowserWindow* window,
28 content::WebContents* web_contents,
29 TranslateBubbleModel::ViewState view_state) {
30 if (current_factory_) {
31 current_factory_->ShowImplementation(window, web_contents, view_state);
32 return;
33 }
34
35 ShowDefault(window, web_contents, view_state);
36 }
37
38 // static
39 void TranslateBubbleFactory::SetFactory(TranslateBubbleFactory* factory) {
40 current_factory_ = factory;
sky 2013/10/23 14:43:29 Shouldn't you delete old? And document ownership.
hajimehoshi 2013/10/24 11:31:14 Done (added a comment to the header). Is it bette
41 }
42
43 // static
44 TranslateBubbleFactory* TranslateBubbleFactory::current_factory_ = NULL;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698