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

Side by Side Diff: chrome/browser/ui/intents/web_intent_constrained_dialog_factory.cc

Issue 7715037: Web Intent Picker UI (implemented as a constrained dialog, linux only) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: linux_views/chromeos fix Created 9 years, 4 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
(Empty)
1 // Copyright (c) 2011 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/intents/web_intent_constrained_dialog_factory.h"
6
7 #include "chrome/browser/ui/intents/web_intent_picker.h"
8 #include "content/browser/tab_contents/constrained_window.h"
9 #include "content/browser/tab_contents/tab_contents.h"
10
11 WebIntentConstrainedDialogFactory::WebIntentConstrainedDialogFactory()
12 : picker_(NULL) {
13 }
14
15 WebIntentConstrainedDialogFactory::~WebIntentConstrainedDialogFactory() {
16 CloseDialog();
17 }
18
19 WebIntentPicker* WebIntentConstrainedDialogFactory::Create(
20 TabContents* tab_contents,
21 WebIntentPickerDelegate* delegate) {
22 // Only allow one picker per factory.
23 DCHECK(picker_ == NULL);
24
25 picker_ = WebIntentPicker::Create(tab_contents, delegate);
26
27 // TODO(binji) Remove this check when there are implementations of the picker
28 // for windows and mac.
29 if (picker_ == NULL)
30 return NULL;
31
32 picker_->Show();
33
34 return picker_;
35 }
36
37 void WebIntentConstrainedDialogFactory::ClosePicker(WebIntentPicker* picker) {
38 DCHECK(picker == picker_);
39 CloseDialog();
40 }
41
42 void WebIntentConstrainedDialogFactory::CloseDialog() {
43 if (picker_) {
44 picker_->Close();
45 picker_ = NULL;
46 }
47 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/intents/web_intent_constrained_dialog_factory.h ('k') | chrome/browser/ui/intents/web_intent_picker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698