| 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 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" | 5 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_shutdown.h" | 10 #include "chrome/browser/browser_shutdown.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 using content::WebContents; | 28 using content::WebContents; |
| 29 using content::WebUIMessageHandler; | 29 using content::WebUIMessageHandler; |
| 30 using ui::WebDialogDelegate; | 30 using ui::WebDialogDelegate; |
| 31 | 31 |
| 32 class MobileSetupDialogDelegate : public WebDialogDelegate { | 32 class MobileSetupDialogDelegate : public WebDialogDelegate { |
| 33 public: | 33 public: |
| 34 static MobileSetupDialogDelegate* GetInstance(); | 34 static MobileSetupDialogDelegate* GetInstance(); |
| 35 void ShowDialog(const std::string& service_path); | 35 void ShowDialog(const std::string& service_path); |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 friend struct DefaultSingletonTraits<MobileSetupDialogDelegate>; | 38 friend struct base::DefaultSingletonTraits<MobileSetupDialogDelegate>; |
| 39 | 39 |
| 40 MobileSetupDialogDelegate(); | 40 MobileSetupDialogDelegate(); |
| 41 ~MobileSetupDialogDelegate() override; | 41 ~MobileSetupDialogDelegate() override; |
| 42 | 42 |
| 43 void OnCloseDialog(); | 43 void OnCloseDialog(); |
| 44 | 44 |
| 45 // WebDialogDelegate overrides. | 45 // WebDialogDelegate overrides. |
| 46 ui::ModalType GetDialogModalType() const override; | 46 ui::ModalType GetDialogModalType() const override; |
| 47 base::string16 GetDialogTitle() const override; | 47 base::string16 GetDialogTitle() const override; |
| 48 GURL GetDialogContentURL() const override; | 48 GURL GetDialogContentURL() const override; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 64 | 64 |
| 65 // static | 65 // static |
| 66 void MobileSetupDialog::Show(const std::string& service_path) { | 66 void MobileSetupDialog::Show(const std::string& service_path) { |
| 67 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 67 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 68 MobileSetupDialogDelegate::GetInstance()->ShowDialog(service_path); | 68 MobileSetupDialogDelegate::GetInstance()->ShowDialog(service_path); |
| 69 } | 69 } |
| 70 | 70 |
| 71 // static | 71 // static |
| 72 MobileSetupDialogDelegate* MobileSetupDialogDelegate::GetInstance() { | 72 MobileSetupDialogDelegate* MobileSetupDialogDelegate::GetInstance() { |
| 73 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 73 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 74 return Singleton<MobileSetupDialogDelegate>::get(); | 74 return base::Singleton<MobileSetupDialogDelegate>::get(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 MobileSetupDialogDelegate::MobileSetupDialogDelegate() : dialog_window_(NULL) { | 77 MobileSetupDialogDelegate::MobileSetupDialogDelegate() : dialog_window_(NULL) { |
| 78 } | 78 } |
| 79 | 79 |
| 80 MobileSetupDialogDelegate::~MobileSetupDialogDelegate() { | 80 MobileSetupDialogDelegate::~MobileSetupDialogDelegate() { |
| 81 } | 81 } |
| 82 | 82 |
| 83 void MobileSetupDialogDelegate::ShowDialog(const std::string& service_path) { | 83 void MobileSetupDialogDelegate::ShowDialog(const std::string& service_path) { |
| 84 service_path_ = service_path; | 84 service_path_ = service_path; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool MobileSetupDialogDelegate::ShouldShowDialogTitle() const { | 152 bool MobileSetupDialogDelegate::ShouldShowDialogTitle() const { |
| 153 return true; | 153 return true; |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool MobileSetupDialogDelegate::HandleContextMenu( | 156 bool MobileSetupDialogDelegate::HandleContextMenu( |
| 157 const content::ContextMenuParams& params) { | 157 const content::ContextMenuParams& params) { |
| 158 return true; | 158 return true; |
| 159 } | 159 } |
| OLD | NEW |