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

Side by Side Diff: chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc

Issue 22611005: Switch over MobileActivator to use Network*Handler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add activation handler files Created 7 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
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"
11 #include "chrome/browser/chromeos/login/login_display_host_impl.h" 11 #include "chrome/browser/chromeos/login/login_display_host_impl.h"
12 #include "chrome/browser/chromeos/login/webui_login_view.h" 12 #include "chrome/browser/chromeos/login/webui_login_view.h"
13 #include "chrome/browser/chromeos/mobile/mobile_activator.h" 13 #include "chrome/browser/chromeos/mobile/mobile_activator.h"
14 #include "chrome/browser/platform_util.h" 14 #include "chrome/browser/platform_util.h"
15 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/browser/ui/browser_dialogs.h" 16 #include "chrome/browser/ui/browser_dialogs.h"
17 #include "chrome/browser/ui/simple_message_box.h" 17 #include "chrome/browser/ui/simple_message_box.h"
18 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
19 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
20 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
21 #include "ui/base/l10n/l10n_util.h" 21 #include "ui/base/l10n/l10n_util.h"
22 #include "ui/gfx/size.h" 22 #include "ui/gfx/size.h"
23 #include "ui/views/widget/widget.h" 23 #include "ui/views/widget/widget.h"
24 #include "ui/web_dialogs/web_dialog_delegate.h" 24 #include "ui/web_dialogs/web_dialog_delegate.h"
25 25
26 using chromeos::CellularNetwork;
27 using chromeos::MobileActivator; 26 using chromeos::MobileActivator;
28 using content::BrowserThread; 27 using content::BrowserThread;
29 using content::WebContents; 28 using content::WebContents;
30 using content::WebUIMessageHandler; 29 using content::WebUIMessageHandler;
31 using ui::WebDialogDelegate; 30 using ui::WebDialogDelegate;
32 31
33 class MobileSetupDialogDelegate : public WebDialogDelegate, 32 class MobileSetupDialogDelegate : public WebDialogDelegate,
34 public MobileActivator::Observer { 33 public MobileActivator::Observer {
35 public: 34 public:
36 static MobileSetupDialogDelegate* GetInstance(); 35 static MobileSetupDialogDelegate* GetInstance();
(...skipping 20 matching lines...) Expand all
57 content::RenderViewHost* render_view_host) OVERRIDE; 56 content::RenderViewHost* render_view_host) OVERRIDE;
58 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; 57 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
59 virtual void OnCloseContents(WebContents* source, 58 virtual void OnCloseContents(WebContents* source,
60 bool* out_close_dialog) OVERRIDE; 59 bool* out_close_dialog) OVERRIDE;
61 virtual bool ShouldShowDialogTitle() const OVERRIDE; 60 virtual bool ShouldShowDialogTitle() const OVERRIDE;
62 virtual bool HandleContextMenu( 61 virtual bool HandleContextMenu(
63 const content::ContextMenuParams& params) OVERRIDE; 62 const content::ContextMenuParams& params) OVERRIDE;
64 63
65 // MobileActivator::Observer overrides. 64 // MobileActivator::Observer overrides.
66 virtual void OnActivationStateChanged( 65 virtual void OnActivationStateChanged(
67 CellularNetwork* network, 66 const chromeos::NetworkState* network,
68 MobileActivator::PlanActivationState state, 67 MobileActivator::PlanActivationState state,
69 const std::string& error_description) OVERRIDE; 68 const std::string& error_description) OVERRIDE;
70 69
71 private: 70 private:
72 gfx::NativeWindow dialog_window_; 71 gfx::NativeWindow dialog_window_;
73 // Cellular network service path. 72 // Cellular network service path.
74 std::string service_path_; 73 std::string service_path_;
75 DISALLOW_COPY_AND_ASSIGN(MobileSetupDialogDelegate); 74 DISALLOW_COPY_AND_ASSIGN(MobileSetupDialogDelegate);
76 }; 75 };
77 76
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 bool MobileSetupDialogDelegate::ShouldShowDialogTitle() const { 172 bool MobileSetupDialogDelegate::ShouldShowDialogTitle() const {
174 return true; 173 return true;
175 } 174 }
176 175
177 bool MobileSetupDialogDelegate::HandleContextMenu( 176 bool MobileSetupDialogDelegate::HandleContextMenu(
178 const content::ContextMenuParams& params) { 177 const content::ContextMenuParams& params) {
179 return true; 178 return true;
180 } 179 }
181 180
182 void MobileSetupDialogDelegate::OnActivationStateChanged( 181 void MobileSetupDialogDelegate::OnActivationStateChanged(
183 CellularNetwork* network, 182 const chromeos::NetworkState* network,
184 MobileActivator::PlanActivationState state, 183 MobileActivator::PlanActivationState state,
185 const std::string& error_description) { 184 const std::string& error_description) {
stevenjb 2013/08/14 02:28:31 Since this does nothing is there any point in impl
gauravsh 2013/08/14 21:42:29 Yeah, I am not sure why this was observing MobileA
186 } 185 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698