OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_COCOA2_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_COCOA2_H_ | 6 #define CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_COCOA_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
11 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.h" | 11 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.h" |
12 #include "chrome/browser/ui/intents/web_intent_picker.h" | 12 #include "chrome/browser/ui/intents/web_intent_picker.h" |
13 #include "chrome/browser/ui/intents/web_intent_picker_model_observer.h" | 13 #include "chrome/browser/ui/intents/web_intent_picker_model_observer.h" |
14 | 14 |
15 @class WebIntentPickerViewController; | 15 @class WebIntentPickerViewController; |
16 | 16 |
17 // An implementation of WebIntentPicker for Cocoa. Bridges between the C++ and | 17 // An implementation of WebIntentPicker for Cocoa. Bridges between the C++ and |
18 // the Cocoa WebIntentPickerViewController object. Note, this will eventually | 18 // the Cocoa WebIntentPickerViewController object. |
19 // replace WebIntentPickerCocoa, see http://crbug.com/152010. | 19 class WebIntentPickerCocoa : public WebIntentPicker, |
20 class WebIntentPickerCocoa2 : public WebIntentPicker, | 20 public WebIntentPickerModelObserver, |
21 public WebIntentPickerModelObserver, | 21 public ConstrainedWindowMacDelegate2 { |
22 public ConstrainedWindowMacDelegate2 { | |
23 public: | 22 public: |
24 WebIntentPickerCocoa2(content::WebContents* web_contents, | 23 WebIntentPickerCocoa(content::WebContents* web_contents, |
25 WebIntentPickerDelegate* delegate, | 24 WebIntentPickerDelegate* delegate, |
26 WebIntentPickerModel* model); | 25 WebIntentPickerModel* model); |
27 virtual ~WebIntentPickerCocoa2(); | 26 virtual ~WebIntentPickerCocoa(); |
28 | 27 |
29 WebIntentPickerDelegate* delegate() const { | 28 WebIntentPickerDelegate* delegate() const { |
30 DCHECK(delegate_); | 29 DCHECK(delegate_); |
31 return delegate_; | 30 return delegate_; |
32 } | 31 } |
33 | 32 |
34 WebIntentPickerModel* model() const { return model_; } | 33 WebIntentPickerModel* model() const { return model_; } |
35 content::WebContents* web_contents() const { return web_contents_; } | 34 content::WebContents* web_contents() const { return web_contents_; } |
36 ConstrainedWindowMac2* constrained_window() const { | 35 ConstrainedWindowMac2* constrained_window() const { |
37 return constrained_window_.get(); | 36 return constrained_window_.get(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 private: | 73 private: |
75 void ScheduleUpdate(); | 74 void ScheduleUpdate(); |
76 void PerformUpdate(); | 75 void PerformUpdate(); |
77 | 76 |
78 content::WebContents* const web_contents_; | 77 content::WebContents* const web_contents_; |
79 WebIntentPickerDelegate* delegate_; | 78 WebIntentPickerDelegate* delegate_; |
80 WebIntentPickerModel* model_; | 79 WebIntentPickerModel* model_; |
81 scoped_nsobject<WebIntentPickerViewController> view_controller_; | 80 scoped_nsobject<WebIntentPickerViewController> view_controller_; |
82 scoped_ptr<ConstrainedWindowMac2> constrained_window_; | 81 scoped_ptr<ConstrainedWindowMac2> constrained_window_; |
83 bool update_pending_; | 82 bool update_pending_; |
84 base::WeakPtrFactory<WebIntentPickerCocoa2> weak_ptr_factory_; | 83 base::WeakPtrFactory<WebIntentPickerCocoa> weak_ptr_factory_; |
85 }; | 84 }; |
86 | 85 |
87 #endif // CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_COCOA2_H_ | 86 #endif // CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_COCOA_H_ |
OLD | NEW |