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

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

Issue 9148032: [Web Intents] Refactor picker to use WebIntentPickerModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: groby's fix Created 8 years, 10 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_picker_factory_impl.h"
6
7 #include "base/logging.h"
8 #include "chrome/browser/ui/intents/web_intent_picker.h"
9
10 WebIntentPickerFactoryImpl::WebIntentPickerFactoryImpl()
11 : picker_(NULL) {
12 }
13
14 WebIntentPickerFactoryImpl::~WebIntentPickerFactoryImpl() {
15 Close();
16 }
17
18 WebIntentPicker* WebIntentPickerFactoryImpl::Create(
19 Browser* browser,
20 TabContentsWrapper* wrapper,
21 WebIntentPickerDelegate* delegate) {
22 // Only allow one picker per factory.
23 DCHECK(picker_ == NULL);
24
25 picker_ = WebIntentPicker::Create(browser, wrapper, delegate);
26 return picker_;
27 }
28
29 void WebIntentPickerFactoryImpl::ClosePicker(WebIntentPicker* picker) {
30 DCHECK(picker == picker_);
31 Close();
32 }
33
34 void WebIntentPickerFactoryImpl::Close() {
35 if (picker_) {
36 picker_->Close();
37 picker_ = NULL;
38 }
39 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker_factory_impl.h ('k') | chrome/browser/ui/intents/web_intent_picker_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698