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

Side by Side Diff: chrome/browser/chromeos/enrollment_dialog_view.cc

Issue 18179004: Dismiss action in tab modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, fix CrOS build 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
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/chromeos/enrollment_dialog_view.h" 5 #include "chrome/browser/chromeos/enrollment_dialog_view.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/chromeos/cros/network_library.h" 9 #include "chrome/browser/chromeos/cros/network_library.h"
10 #include "chrome/browser/extensions/extension_host.h" 10 #include "chrome/browser/extensions/extension_host.h"
(...skipping 27 matching lines...) Expand all
38 38
39 static void ShowDialog(gfx::NativeWindow owning_window, 39 static void ShowDialog(gfx::NativeWindow owning_window,
40 const std::string& network_name, 40 const std::string& network_name,
41 Profile* profile, 41 Profile* profile,
42 const GURL& target_uri, 42 const GURL& target_uri,
43 const base::Closure& connect); 43 const base::Closure& connect);
44 44
45 // views::DialogDelegateView overrides 45 // views::DialogDelegateView overrides
46 virtual int GetDialogButtons() const OVERRIDE; 46 virtual int GetDialogButtons() const OVERRIDE;
47 virtual bool Accept() OVERRIDE; 47 virtual bool Accept() OVERRIDE;
48 virtual void OnClose() OVERRIDE; 48 virtual void OnClosed() OVERRIDE;
49 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; 49 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
50 50
51 // views::WidgetDelegate overrides 51 // views::WidgetDelegate overrides
52 virtual ui::ModalType GetModalType() const OVERRIDE; 52 virtual ui::ModalType GetModalType() const OVERRIDE;
53 virtual string16 GetWindowTitle() const OVERRIDE; 53 virtual string16 GetWindowTitle() const OVERRIDE;
54 54
55 // views::View overrides 55 // views::View overrides
56 virtual gfx::Size GetPreferredSize() OVERRIDE; 56 virtual gfx::Size GetPreferredSize() OVERRIDE;
57 57
58 private: 58 private:
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 int EnrollmentDialogView::GetDialogButtons() const { 106 int EnrollmentDialogView::GetDialogButtons() const {
107 return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK; 107 return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK;
108 } 108 }
109 109
110 bool EnrollmentDialogView::Accept() { 110 bool EnrollmentDialogView::Accept() {
111 accepted_ = true; 111 accepted_ = true;
112 return true; 112 return true;
113 } 113 }
114 114
115 void EnrollmentDialogView::OnClose() { 115 void EnrollmentDialogView::OnClosed() {
116 if (!accepted_) 116 if (!accepted_)
117 return; 117 return;
118 chrome::NavigateParams params(profile_, 118 chrome::NavigateParams params(profile_,
119 GURL(target_uri_), 119 GURL(target_uri_),
120 content::PAGE_TRANSITION_LINK); 120 content::PAGE_TRANSITION_LINK);
121 params.disposition = NEW_FOREGROUND_TAB; 121 params.disposition = NEW_FOREGROUND_TAB;
122 params.window_action = chrome::NavigateParams::SHOW_WINDOW; 122 params.window_action = chrome::NavigateParams::SHOW_WINDOW;
123 chrome::Navigate(&params); 123 chrome::Navigate(&params);
124 } 124 }
125 125
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 //////////////////////////////////////////////////////////////////////////////// 246 ////////////////////////////////////////////////////////////////////////////////
247 // Factory function. 247 // Factory function.
248 248
249 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window, 249 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window,
250 const std::string& network_name, 250 const std::string& network_name,
251 Profile* profile) { 251 Profile* profile) {
252 return new DialogEnrollmentDelegate(owning_window, network_name, profile); 252 return new DialogEnrollmentDelegate(owning_window, network_name, profile);
253 } 253 }
254 254
255 } // namespace chromeos 255 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698